Getting started
- Introduction
- Prerequisites
- Quickstart
Spark API
- Reference
- Chat
- Insights
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": "What is the average age of social media users in Greece who access these platforms daily?"
}'
{
"message": "Based on your input, here are some interesting Insights:",
"insights": [
{
"id": "75f1f21a-9157-412e-bdcf-d6af93a4f4dc",
"text": "30% of social media users in Greece who spend 3 or more hours daily on these platforms are part of Gen Z."
},
{
"id": "02e9c8a5-d42f-4a6d-b7d8-c238f2208d44",
"text": "24% of this audience falls within the age range of 16 to 24 years old."
}
],
"chat_id": "9b1507d7-16d5-4f26-8d64-69d34e23e9f0",
"sources": {
"topics": [
"Facebook usage"
],
"audiences": [
{
"id": "c95451a1-b936-42a3-9a1c-13b5b43c20a6",
"name": "Heavy social networkers",
"description": "Individuals who spend between 3 and more than 10 hours on social media on an average day."
}
],
"datasets": [
{
"code": "ds-core",
"name": "GWI Core"
}
],
"locations": [
{
"code": "s2_30",
"name": "Greece"
}
],
"waves": [
{
"code": "q3_2024",
"name": "Q3 2024"
},
{
"code": "q4_2024",
"name": "Q4 2024"
}
]
}
}
Authorizations
Body
application/json
Chat request payload.
Request payload for chat.
Response
200
application/json
Successful response
Response payload for chat.
curl --request POST \
--url https://api.globalwebindex.com/v1/spark-api/generic \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '{
"prompt": "What is the average age of social media users in Greece who access these platforms daily?"
}'
{
"message": "Based on your input, here are some interesting Insights:",
"insights": [
{
"id": "75f1f21a-9157-412e-bdcf-d6af93a4f4dc",
"text": "30% of social media users in Greece who spend 3 or more hours daily on these platforms are part of Gen Z."
},
{
"id": "02e9c8a5-d42f-4a6d-b7d8-c238f2208d44",
"text": "24% of this audience falls within the age range of 16 to 24 years old."
}
],
"chat_id": "9b1507d7-16d5-4f26-8d64-69d34e23e9f0",
"sources": {
"topics": [
"Facebook usage"
],
"audiences": [
{
"id": "c95451a1-b936-42a3-9a1c-13b5b43c20a6",
"name": "Heavy social networkers",
"description": "Individuals who spend between 3 and more than 10 hours on social media on an average day."
}
],
"datasets": [
{
"code": "ds-core",
"name": "GWI Core"
}
],
"locations": [
{
"code": "s2_30",
"name": "Greece"
}
],
"waves": [
{
"code": "q3_2024",
"name": "Q3 2024"
},
{
"code": "q4_2024",
"name": "Q4 2024"
}
]
}
}
Assistant
Responses are generated using AI and may contain mistakes.