Skip to content

Enrich a small batch

A list request enriches up to 10 businesses in one response. It is the same POST /v1/enrich endpoint: send pois instead of a top-level poi_name.

Send a small enrichment batch

Each place in pois can request its own attributes, or leave them out to use the request’s shared list.

Send coordinates as a pair, latitude and longitude in decimal degrees (WGS84).

curl https://api.voygr.tech/v1/enrich \
  --request POST \
  --header "X-API-Key: $VOYGR_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "pois": [
      {
        "id": "bakery-001",
        "poi_name": "Example Bakery",
        "address": "123 Example Street",
        "latitude": 37.7749,
        "longitude": -122.4194,
        "country": "US",
        "attributes": ["phone", "website"]
      },
      {
        "id": "cafe-002",
        "poi_name": "Example Cafe",
        "address": "456 Sample Avenue",
        "latitude": 37.7755,
        "longitude": -122.4183,
        "country": "US",
        "attributes": ["opening_hours"]
      }
    ]
  }'

Standard attributes cost one credit per place, however many a place asks for, and only when at least one returns a value, so this request costs up to two credits. Any other attribute name is a research field at one credit per place per field; a place can ask for both and pays for each.

Interpret the small-batch response

The response carries success, rows, meta and enrichment_timestamp. rows has one entry per place, in request order, with your id echoed back. Each row’s fields maps the attributes that place asked for to results: value is the answer, or null when it could not be established, and status says how sure we are. A null value is a normal result, not an error.

A row’s status is enriched when at least one attribute has a confirmed or estimated value, abstain when none does, or error when that place failed; outcome repeats enriched or abstain. An error row carries an error message and never fails the request. meta.estimated_credits is present on every response.

Handle small-batch errors

A request with no places or more than 10 returns 400; for VALIDATION_ERROR, detail lists the invalid fields, messages and error types. 401 and 403 are authentication and access errors. 402 means not enough available credits; waiting will not fix it. For 429, wait and follow Retry-After when returned. Errors the gateway returns itself (401, 403, 402 when the balance cannot cover the request, and the 429 rate limit) put the message inside detail, for example {"detail": {"error": "invalid API key"}}, with no request_id. A 502 with error_code: BACKEND_ERROR or a 504 with error_code: BACKEND_TIMEOUT means the service behind the gateway failed or timed out; nothing is charged, so retry later. Those bodies come from the gateway too: error and error_code at the top level, with no request_id and no detail wrapper.

If one place’s coordinates cannot be resolved, the request still returns 200: that row has status: error and an error, and the other places continue. Correct the coordinates or add an address before resubmitting it.