POST
/
v1
/
spark-api
/
generic
Chat with the service
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

Authorization
string
header
required

Body

application/json

Chat request payload.

Request payload for chat.

prompt
string
required

The chat prompt.

chat_id
string

The chat session ID (assigned at 1st prompt).

Example:

""

docked_audiences
string[]

The audiences ids (UUIDs) to dock and produce insights for. These audiences are created via GWI platform and need to be shared within the organization. The list can be found using /v2/saved/audiences.

Example:
[
"00000000-0000-0000-0000-000000000000",
"00000000-0000-0000-0000-000000000001"
]

Response

Successful response

Response payload for chat.

message
string
required

The chat response message.

insights
object[]
required

Insights related to the chat.

chat_id
string
required

The chat session ID.

sources
object
required

Metadata about the sources used for insights.