# Using HF API with ReactJS

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fusing-hf-api-with-reactjs%2F12687%3E%5C
**Category:** Beginners\
**Created:** [December 10, 2021, 3:44am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fusing-hf-api-with-reactjs%2F12687 "2021-12-10T03:44:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![djmonrush](https://avatars.discourse-cdn.com/v4/letter/d/bbce88/32.png) [@djmonrush](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fdjmonrush)%5C
**Post date:** [December 10, 2021, 3:44am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fusing-hf-api-with-reactjs%2F12687%2F1 "2021-12-10T03:44:00Z")

</div>

I’m trying to make a call to the large-bert model to do a summary task but the response is always the same generic “[CNN.com](http://CNN.com) will feature iReporter photos in a weekly Travel Snapshots gallery. Please submit your best shots of the U.S. for next week. Visit [CNN Travel | Global Destinations, Tips & Video](http://CNN.com/Travel) next Wednesday for a new gallery of snapshots. Please share your best photos of the United States with CNN iReport.” Which has nothing to do with my test input from wikipedia.

I was wondering if there was an explanation. Am I missing some input or passing the data wrong?

The following is the attempted code using  
`  
const response = await fetch(

```
            "/static-proxy?url=https%3A%2F%2Fapi-inference.huggingface.co%2Fmodels%2Ffacebook%2Fbart-large-cnn",

            {

                headers: { Authorization: `Bearer ${API_TOKEN}` },

                method: "POST",

                data: {

                    "inputs": JSON.stringify(script),

                    "parameters": {"do_sample": false},

                },

            }

        );

        const result = await response.json();

        setSummation(JSON.stringify(result[0].summary_text))

```

`
