Using Statista’s Research AI API to create or complement a chatbot
We’re working on this feature in beta. If you’re interested, reach out to: connect@statista.com for a beta key.
This guide provides a simple workflow example of the Research AI API.
Using your API key, submit a question to the POST endpoint described in the API Reference.
In the response we should receive a researchToken
that can be used to poll the
answer
endpoint.
You should continue polling the answer endpoint until the response contains a status of “done” in
the state.status
field, indicating that the answer is ready.
On a successful poll, you’ll be able to fetch the answer from the payload:
In addition you’ll be able to extract key facts and sources that the answer is based on: