# Hugging face space api integration

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhugging-face-space-api-integration%2F136358%3E%5C
**Category:** Beginners\
**Created:** [January 18, 2025, 7:16pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhugging-face-space-api-integration%2F136358 "2025-01-18T19:16:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gurulokeshuppala](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/gurulokeshuppala/32/39397_2.png) [@gurulokeshuppala](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fgurulokeshuppala)%5C
**Post date:** [January 18, 2025, 7:16pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhugging-face-space-api-integration%2F136358%2F1 "2025-01-18T19:16:52Z")

</div>

I am using wix chatbot and I need to integrate my public space API in the chat, but I am struck in creating the request payload to my API.

I am not sure how to build a request pay load for the API.

By using the iframe code, and ran the space with html file and analyzed it with network tab and got below.

Request URL:  
[https://MyHugging](https://MyHugging) Face space name.hf.space/gradio\_api/run/predict  
Request Method:  
POST  
Status Code:  
200 OK  
Remote Address:  
50.17.216.56:443  
Referrer Policy:  
strict-origin-when-cross-origin

And the request payload in the network tab was,  
{data: [“hi”,], event\_data: null, fn\_index: 0, trigger\_id: 8, session\_hash: “ntwomc7trv”}  
data: [“hi”,]  
event\_data: null  
fn\_index: 0  
session\_hash: “ntwomc7trv”  
trigger\_id: 8

Here, “hi” is the only word that i gave as input through the iframe UI, rest all attributes were automatically generated by the gradio. Now I am not sure how to fill these attributes when I am using this in my js script. is there any other format for this?

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FJohn6666)%5C
**Post date:** [January 19, 2025, 5:26am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhugging-face-space-api-integration%2F136358%2F2 "2025-01-19T05:26:24Z")

</div>

Click on “Use via API” at the bottom of each space for more information.

> **[Querying Gradio Apps With Curl](https://www.gradio.app/main/guides/querying-gradio-apps-with-curl)**
>
> A Step-by-Step Gradio Tutorial

> **[Getting Started With The Js Client](https://www.gradio.app/guides/getting-started-with-the-js-client)**
>
> A Step-by-Step Gradio Tutorial

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/hellohellohello/original/2X/d/de4155eb4aa4108ecb32a1389d7cc37ae69f88b7.png) [@system](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fsystem)%5C
**Post date:** [January 19, 2025, 5:26pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhugging-face-space-api-integration%2F136358%2F3 "2025-01-19T17:26:58Z")

</div>

Closed on January 19, 2025, 5:26pm UTC

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.
