REST API · v1

Build with
the world's mood.

JSON over HTTPS. Bearer auth. Free tier. CC-BY-4.0 data license. Every endpoint is cached at the edge for <100ms global latency.

Authentication

Send your key with every request.

Use either header. Keys begin with gei_.

# Recommended
curl https://globalemotionsindex.com/api/v1/public/global \
  -H 'Authorization: Bearer gei_live_xxxxxxxxxxxx'

# Alternative
curl https://globalemotionsindex.com/api/v1/public/global \
  -H 'X-API-Key: gei_live_xxxxxxxxxxxx'
Endpoints

Seven endpoints. Everything you need.

GET/api/v1/public/global

Returns the current global snapshot: total submissions, country count, emotional index, positivity score, stress score, dominant emotion.

curl /api/v1/public/global -H 'Authorization: Bearer YOUR_KEY'

GET/api/v1/public/countries

List of all countries with scorecards. Returns ISO codes, name, total submissions, all five scores, and deltas (24h / 7d / 30d).

limit
Max rows (1–500, default 200)
iso3
Optional — returns a single country

GET/api/v1/public/rankings

Countries sorted by a metric of your choice, with minimum-sample filtering.

metric
emotional_index | positivity_score | stress_score | resilience_score | volatility_score | total_submissions
dir
asc | desc (default desc)
limit
1–200 (default 50)
min
Minimum submissions to include a country (default 30)

GET/api/v1/public/forecast?iso3=USA

Holt-Winters forecast for 24h / 7d / 30d horizons. Returns point estimate + 80% and 95% prediction intervals.

GET/api/v1/public/trends?iso3=USA&days=30

Daily submission counts per emotion for the requested country and window (7–365 days).

GET/api/v1/public/export?type=daily

Public CSV/JSON exports. Aggregate-only, no key required. Suitable for academic citation under CC-BY-4.0.

type
daily | countries | dataset
Code samples

Pick your language.

cURL

curl -s https://globalemotionsindex.com/api/v1/public/rankings?metric=stress_score \
  -H 'Authorization: Bearer YOUR_KEY' | jq

JavaScript

const r = await fetch(
  'https://globalemotionsindex.com/api/v1/public/global',
  { headers: { 'Authorization': 'Bearer ' + KEY } }
);
const data = await r.json();

Python

import requests
r = requests.get(
  'https://globalemotionsindex.com/api/v1/public/global',
  headers={'Authorization': f'Bearer {KEY}'}
)
data = r.json()
Pricing

Free for research.
Pro for products.

Free

$0

For learning, side projects, academic use.

  • 1,000 requests / day
  • 60 requests / minute
  • Full endpoint access
  • CC-BY-4.0 license
  • Best-effort support

Enterprise

Custom

For high-volume integrations and research.

  • 1M+ requests / day
  • SLA + uptime guarantee
  • Dedicated capacity
  • Custom data delivery
  • White-glove onboarding
Response format

Predictable JSON envelope.

{
  "request": {
    "endpoint": "./api/v1/public/global",
    "tier": "free"
  },
  "quota": {
    "remaining_per_minute": 58,
    "remaining_per_day": 994
  },
  "data": {
    "total_submissions": 1043217,
    "total_countries": 174,
    "emotional_index": 58.4,
    "positivity_score": 61.2,
    "stress_score": 28.7,
    "dominant_emotion": "calm"
  }
}

Errors arrive as { "error": "..." } with HTTP status codes. 429 includes Retry-After.