# Query indexes from react app

**URL:** <https://discuss.elastic.co/t/query-indexes-from-react-app/235747>\
**Category:** Elasticsearch\
**Created:** [June 4, 2020, 12:15pm UTC](https://discuss.elastic.co/t/query-indexes-from-react-app/235747 "2020-06-04T12:15:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![raghav\_yadav](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raghav_yadav/32/45300_2.png) [@raghav\_yadav](https://discuss.elastic.co/u/raghav_yadav)\
**Post date:** [June 4, 2020, 12:15pm UTC](https://discuss.elastic.co/t/query-indexes-from-react-app/235747/1 "2020-06-04T12:15:56Z")

</div>

I am trying to query an index from my react application using axios, but I am unable to get the API endpoint link which I should be querying.

```auto
    const query = {
        "query": {
            "match_all": {}
          }
    }
    componentDidMount() {
        Axios.get('https://API ENDPOINT/.kibana_1/_doc/_search', {
        auth: {
            username: 'elastic',
            password: ' ******'
        },    
        params: {
                source: JSON.stringify(query),
                source_content_type: 'application/json'
            }
        })
        .then(
            response => console.log(response), 
            error => console.log(error)
        )
    }

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 2, 2020, 12:16pm UTC](https://discuss.elastic.co/t/query-indexes-from-react-app/235747/2 "2020-07-02T12:16:03Z")

</div>

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