API pipeline: Find projects by place and on the map

Index: API pipelines — index

Goal: find projects (and other cards) in a city or country and place them on a map.

No token needed for public cards.

Steps

  1. Find the place.
GET /v0/search/geo/cities?q=tashkent&limit=10
→ {"hits": [{"geonameid": 1512569, "name": "Tashkent", "country_iso": "UZ", "country_name": "Uzbekistan",
             "lat": 41.26465, "lon": 69.21627, "label": "Tashkent, UZ"}]}

GET /v0/search/geo/countries?q=uzbek
→ {"hits": [{"iso": "UZ", "name": "Uzbekistan"}]}

country=UZ narrows cities to one country. One place by id: GET /v0/geo/cities/{geonameid}, GET /v0/geo/countries/{iso}.

  1. Turn it into a place card. Filters take place nonces, not geonameids or ISO codes.
GET /v0/graph/resolve/@rub.geo-1512569   → {"card_type": "rubric", "nonce": "<city place>", "kind": "place", …}
GET /v0/graph/resolve/@rub.geo-uz        → {"card_type": "rubric", "nonce": "<country place>", "kind": "place", …}

A city is @rub.geo-<geonameid>, a country @rub.geo-<iso, lowercase>.

  1. Search in it.
POST /v0/search/graph
{"query": "", "card_type": "project", "filters": {"locations": ["<country place>"]}, "limit": 50}
→ {"hits": [{"title": "…", "location": {"nonce": "…", "title": "Tashkent", "geo": {"lat": 41.27, "lon": 69.25}}, …}], …}
  1. Map it. Each hit's location.geo (lat, lon) is the pin; hits without location have no pin. A single card's page carries the same location.

  2. Browse a place: GET /v0/graph/rubrics/{place nonce}?contained_limit=50 → the place card with geo and contained (the places inside it).

Behind

Rules

API surface

Endpoint Purpose FE AI / oracle
GET /v0/search/geo/cities Cities by name yes (city pickers) yes
GET /v0/search/geo/countries Countries by name yes yes
GET /v0/geo/cities/{geonameid}, /v0/geo/countries/{iso} One place yes yes
GET /v0/graph/resolve/@rub.geo-… Place card nonce yes yes
POST /v0/search/graph Cards in or near a place yes yes
GET /v0/graph/rubrics/{nonce} A place and what it contains yes yes

Mentioned