Skip to content

Risk API reference

Base URL https://api.travelriskapi.com/api/v1. Send your key in the X-API-Key header. All responses are JSON.

Risk score

GET /risk-score/{iso_code}

A 1–5 score for one country: the highest government advisory level plus up to +2 from active alerts, with diminishing returns, capped at 5.

  • Each active alert is weighted by severity: Critical 1.0, High 0.5, Medium 0.25, Low 0.
  • Local, zone-level warnings (US National Weather Service counties and forecast zones) count 1/20, so a stormy day in a few counties does not mark the whole country as high risk.
  • Impact = 2 × (1 − e^(−weight / 4)). One Critical alert adds about 0.4; a country at advisory level 1 cannot exceed 3.

The breakdown (base_score, alert_impact, alerts_by_severity, method) is returned so you can show why.

curl -H "X-API-Key: $KEY" https://api.travelriskapi.com/api/v1/risk-score/TUR
{
  "iso_code": "TUR",
  "name": "Turkey",
  "risk_score": 2.0,
  "advisory_level": 2,
  "active_alerts": 13,
  "calculation": {
    "base_score": 2.0,
    "alert_impact": 0.0,
    "composite": 2.0,
    "method": "v2: advisory level + 2*(1-exp(-weighted_alerts/4)); local (zone-level) alerts x0.05"
  },
  "alerts_by_severity": {
    "Low": 13
  }
}

Countries

GET /countries

All countries with advisory level and risk score. Query: skip (default 0), limit (default 50, max 1000).

GET /countries/{iso_code}

One country. Accepts alpha-3 or alpha-2.

{
  "iso_code": "TUR",
  "name": "Turkey",
  "advisory_level": 2,
  "advisory_description": "Exercise increased caution<p><b>Exercise increased caution</b> in <b>Türkiye </b>due to <b>terrorism</b>, <b>armed conflict</b>, and <b>a...",
  "advisory_date": "2026-06-09T00:00:00",
  "risk_score": 2.0,
  "last_updated": "2026-10-08T19:10:27"
}

GET /countries/codes

Every supported country code in one response, without pagination.

Advisories

GET /advisories

Government travel advisories grouped by country. Each country lists the individual agency assessments in sources and their highest level in max_level.

Parameter Description
country_iso One country, alpha-3 or alpha-2
min_level Only countries whose max_level is at least this value (1–4)

Levels: 1 normal precautions · 2 increased caution · 3 reconsider travel · 4 do not travel.

{
  "total": 1,
  "data": [
    {
      "iso_code": "TUR",
      "name": "Türkiye",
      "sources": [
        {
          "agency": "agency-3",
          "level": 2,
          "summary_label": "Exercise Increased Caution",
          "url": "https://travel.gc.ca/destinations/turkiye",
          "updated_at": "2026-09-29T16:00:00"
        }
      ],
      "max_level": 2,
      "summary_label": "Exercise Increased Caution",
      "reasons": []
    }
  ],
  "fetched_at": "2026-10-08T19:10:39.420270",
  "attribution": {
    "service": "TravelRisk API — aggregated authoritative data feeds."
  }
}

Alerts

GET /alerts

Active natural-hazard and weather alerts, refreshed every 6 hours.

Parameter Description
country_iso Filter by country, alpha-3 or alpha-2
severity Low, Medium, High, Critical
alert_type earthquake, flood, wildfire, cyclone, volcano, drought, severe_storm, humanitarian
days Only events from the last N days (1–365)
updated_since ISO 8601 timestamp — only alerts created or revised since then. Use it for incremental sync
skip, limit Pagination, limit up to 1000

An alert keeps its id when the source revises it; the record is updated in place and updated_at moves.

{
  "total": 16805,
  "skip": 0,
  "limit": 1,
  "filters": {
    "severity": "High",
    "alert_type": null,
    "country_iso": null,
    "days": null,
    "updated_since": null
  },
  "data": [
    {
      "id": 75533,
      "alert_type": "flood",
      "severity": "High",
      "country_iso": "USA",
      "location": "Pasco, FL",
      "latitude": 28.169999999999998,
      "longitude": -82.364,
      "description": "...The Flood Warning is extended for the following rivers in\nFlorida...\n\nCypress Creek At SR 54 Worthington Gardens affecting Pasco Count...",
      "event_date": "2026-10-11T08:00:00",
      "created_at": "2026-10-08T18:43:20.770908",
      "updated_at": "2026-10-08T18:43:20.770910",
      "source": "weather",
      "external_id": "trk-1b230f168a906eb8"
    }
  ],
  "data_updated_at": "2026-10-08T19:05:26.823328",
  "generated_at": "2026-10-08T19:10:39+00:00"
}

GET /alerts/{alert_id}

One alert, including its affected-area polygon when the source provides one.

Conflicts

GET /conflicts

Armed clashes, assaults, coercion and mass violence, refreshed every 15 minutes, rolling 30-day window.

Parameter Description
country_iso Filter by country, alpha-3 or alpha-2
days Look-back window, 1–30, default 7
min_severity Low, Medium, High, Critical
skip, limit Pagination, limit up to 1000
{
  "total": 1002,
  "skip": 0,
  "limit": 1,
  "filters": {
    "days": 7,
    "country": null,
    "country_iso": "UKR",
    "min_severity": null
  },
  "data": [
    {
      "id": 930231,
      "external_id": "trk-7c6dcd8775d80761",
      "event_code": "1712",
      "event_root_code": "17",
      "country_iso": "UKR",
      "location": "Kyiv, Kyyiv, Misto, Ukraine",
      "latitude": 50.4333,
      "longitude": 30.5167,
      "description": "Coercive action (UKRAINIAN — RUSSIA)",
      "event_date": "2026-10-08T00:00:00",
      "num_mentions": 2,
      "severity": "Medium",
      "source_url": "https://www.breitbart.com/europe/2026/10/08/30-killed-in-russian-air-strike-on-civilian-bus-stop/"
    }
  ],
  "fetched_at": "2026-10-08T19:10:39.512327",
  "attribution": {
    "service": "TravelRisk API — aggregated authoritative data feeds."
  }
}

Account

POST /register

Body {"email": "you@company.com"}. Returns a free key and emails it.

POST /recover-key

Body {"email": "..."}. Emails the key registered to that address.

GET /usage

Your own usage by day. Query days (default 7).

GET /billing/plans

Current plans and credit packs. No key needed.

Responses, headers and errors

Every response carries quota headers: X-Quota-Limit, X-Quota-Used, X-Quota-Remaining, X-Credits-Balance, plus X-RateLimit-Limit and X-RateLimit-Remaining for the per-minute burst limit. Responses are cached on our side for up to 15 minutes; X-Cache and ETag tell you when.

Status Meaning
400 / 422 A parameter is missing or invalid; the body names it
401 Missing or unknown API key
404 No such country, alert or route
429 Burst limit or daily quota reached; see Retry-After
500 / 502 Our side; retry with backoff

The full machine-readable spec is at /openapi.json.

Trip assessment

POST /trips/assess

Check a whole itinerary in one call. Send flights (flight number and/or airports) and stays (country). For each segment you get the destination country's risk score and advisory levels by government, the active alerts within 300 km of the arrival airport (or anywhere in the country for a stay), and live status for flights departing within 48 hours. flags lists what needs attention, most severe first.

curl -X POST https://api.travelriskapi.com/api/v1/trips/assess \
  -H "X-API-Key: $KEY" -H "Content-Type: application/json" \
  -d '{"trip_id": "T-1001", "segments": [
        {"type": "flight", "flight": "UA1", "from_airport": "SFO", "to_airport": "SIN"},
        {"type": "flight", "from_airport": "SIN", "to_airport": "MNL", "start": "2026-10-20T08:00:00Z"},
        {"type": "stay", "country": "PHL", "city": "Manila"}]}'
{
  "trip_id": "T-1001",
  "trip_risk_score": 2.93,
  "flags": [
    {"segment": 2, "severity": "Critical", "message": "Critical earthquake alert in Philippines"},
    {"segment": 1, "severity": "High", "message": "High volcano alert in Philippines 55 km from MNL"}
  ],
  "segments": [ "… per segment: destination, country (risk_score, advisory_level, advisories), alerts, flight_status …" ]
}

Counts as one request; live flight lookups also count as aviation calls on the same key.