انتقل إلى المحتوى
The Consortium

Risks Index APIOperational

grx_profiles_query

Aggregate source observations across places (compute)

Request

جرّبه

Available · MCP tool grx.profiles_query · 10 credits per job

https://api.risksindex.com

POST/v1/profiles/query

curl -s -X POST "https://api.risksindex.com/v1/profiles/query" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: <a-unique-key-per-attempt>" \
  -d '{}'
const res = await fetch("https://api.risksindex.com/v1/profiles/query", { method: "POST", headers: { "Content-Type": "application/json", "Idempotency-Key": "<a-unique-key-per-attempt>" }, body: "{}" });
const { data, meta } = await res.json();
import json, urllib.request

req = urllib.request.Request("https://api.risksindex.com/v1/profiles/query", data="{}".encode(), method="POST", headers={"Content-Type": "application/json", "Idempotency-Key": "<a-unique-key-per-attempt>"})
with urllib.request.urlopen(req) as res:
    answer = json.load(res)

200 OKapplication/json

{
  "data": {
    "rows": [
      {}
    ],
    "missingCountries": [
      "string"
    ]
  },
  "meta": {
    "authority": "string",
    "state": "string",
    "provenance": "…",
    "coverage": {
      "status": "full",
      "records": 0,
      "dimensions": {}
    },
    "review": {}
  }
}

A custom aggregation over the edition's Parquet partitions (embedded engine, no database): countries (1 to 60), level (0, 1, 2 or 3), measures (1 to 20), optional sections, parent and H3 cells (resolution 4 or finer), groupBy (iso3, parent, measure, none) and agg (sum, mean, min, max, count, median). Answers the groups with their sources, licences and vintages, and the cost of the job (rows scanned, bytes read, CPU milliseconds). Metered as a compute job; never a value, score, rank or class of the Index. Availability: Available.

Parameters

Parameters

  • editionoptional

    query · string

    An edition id of the profiles register (idx- and 20 hex) or current

  • Idempotency-Keyoptional

    header · string

    Optional. A value of your own (a UUID is fine) that makes this write safe to retry: the same caller, key and request within 24 hours gets the first answer again, with the header Idempotent-Replayed: true, and the work is not done twice. It applies to a request that carries a credential.

Answers

Responses

  • 200

    Records with provenance, coverage and links

  • 400Problem, RFC 9457

    Bad request body. Codes: BAD_BUILD, BAD_JSON, BAD_PROFILE_QUERY

  • 401

  • 402

  • 404Problem, RFC 9457

    Edition not held. Codes: EDITION_NOT_HELD, NOT_FOUND

  • 409

  • 413Problem, RFC 9457

    Query too large. Codes: QUERY_TOO_LARGE, TOO_LARGE

  • 414

  • 422

  • 429Problem, RFC 9457

    Rate limited. Codes: RATE_LIMITED

  • 500Problem, RFC 9457

    Internal error. Codes: INTERNAL

  • 503Problem, RFC 9457

    Profiles unavailable. Codes: PROFILES_UNAVAILABLE

ابدأ

Get a key with a free account, or choose who the account is for, its seats and any council, and see your workstation first.