React Native Retail SDK - Discovery API
  • 12 Oct 2023
  • 1 Minute to read
  • Contributors
  • Dark
    Light

React Native Retail SDK - Discovery API

  • Dark
    Light

Article summary

To use the Discovery API in React Native you can call the Discovery API directly. You can find the documentation for the API here: https://developer.ticketmaster.com/products-and-docs/apis/discovery-api/v2/

Here is an example:

...
 const entityIds = ['K8vZ9171o57', 'K8vZ91718XV'].join(',')

 useEffect(() => {
        fetch(`https://app.ticketmaster.com/discovery/v2/attractions.json?id=${entityIds}&sort=relevance,desc&extensions=ticketmaster&size=200&page=${page}&locale=en-us&view=internal&apikey=${apiKey}`)
            .then((response) => response.json())
            .then((data) => {
               console.log(data._embedded.attractions)
            });
    }, [entityIds, page])

...

Obtain an API key through your developer account


Was this article helpful?