Chat
Chat with the service
Getting started
- Introduction
- Prerequisites
- Quickstart
Spark API
- Reference
Chat
Chat with the service
Endpoint to chat with the service using a prompt and chat ID.
POST
/
v1
/
spark-api
/
generic
curl --request POST \
--url https://api.globalwebindex.com/v1/spark-api/generic \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "How many Germans aged between 25 and 34 use Facebook daily?"
}'
{
"message": "Based on your input, here are some interesting Insights:",
"insights": [
"46% of individuals aged 25-34 in Germany use social media while watching TV.",
"People aged 25-34 in Germany are 17% more likely to visit Facebook weekly or monthly compared to the average person.",
"Only 6.6% of individuals aged 25-34 in Germany consider Facebook their favorite social media platform.",
"Individuals aged 25-34 in Germany are 37% less likely to visit Facebook more than once a day compared to the average person.",
"27% of individuals aged 25-34 in Germany use Facebook and Facebook Messenger to stay updated with news and the world."
],
"chat_id": "12a3b45c-67d8-90e1-f2g3-h4i5j6k7l8m9n",
"sources": {
"topics": [
"Facebook usage"
],
"audiences": [
{
"id": "2d748e13-829b-4ebd-ab90-6fdbbfe8cf66",
"name": "German-Speaking Millennials Survey Group",
"description": "This audience consists of individuals who selected German when completing the survey and are between 25 and 34 years old."
}
],
"datasets": [
{
"code": "ds-core",
"name": "GWI Core"
}
],
"locations": [
{
"code": "s2_49",
"name": "Germany"
}
],
"waves": [
{
"code": "q1_2024",
"name": "Q1 2024"
},
{
"code": "q2_2024",
"name": "Q2 2024"
},
{
"code": "q3_2024",
"name": "Q3 2024"
},
{
"code": "q4_2024",
"name": "Q4 2024"
}
]
}
}
Authorizations
Body
application/json
Chat request payload.
Request payload for chat.
The chat prompt.
The chat session ID (assigned at 1st prompt).
Example:
""
Response
200
application/json
Successful response
Response payload for chat.
The chat response message.
Insights related to the chat.
The chat session ID.
Metadata about the sources used for insights.
List of topics related to the insights.
curl --request POST \
--url https://api.globalwebindex.com/v1/spark-api/generic \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "How many Germans aged between 25 and 34 use Facebook daily?"
}'
{
"message": "Based on your input, here are some interesting Insights:",
"insights": [
"46% of individuals aged 25-34 in Germany use social media while watching TV.",
"People aged 25-34 in Germany are 17% more likely to visit Facebook weekly or monthly compared to the average person.",
"Only 6.6% of individuals aged 25-34 in Germany consider Facebook their favorite social media platform.",
"Individuals aged 25-34 in Germany are 37% less likely to visit Facebook more than once a day compared to the average person.",
"27% of individuals aged 25-34 in Germany use Facebook and Facebook Messenger to stay updated with news and the world."
],
"chat_id": "12a3b45c-67d8-90e1-f2g3-h4i5j6k7l8m9n",
"sources": {
"topics": [
"Facebook usage"
],
"audiences": [
{
"id": "2d748e13-829b-4ebd-ab90-6fdbbfe8cf66",
"name": "German-Speaking Millennials Survey Group",
"description": "This audience consists of individuals who selected German when completing the survey and are between 25 and 34 years old."
}
],
"datasets": [
{
"code": "ds-core",
"name": "GWI Core"
}
],
"locations": [
{
"code": "s2_49",
"name": "Germany"
}
],
"waves": [
{
"code": "q1_2024",
"name": "Q1 2024"
},
{
"code": "q2_2024",
"name": "Q2 2024"
},
{
"code": "q3_2024",
"name": "Q3 2024"
},
{
"code": "q4_2024",
"name": "Q4 2024"
}
]
}
}