Search API
Full-text search for places, businesses, and addresses across West Africa. Powered by PostGIS with proximity ranking, the Search API returns the most relevant results near a given location.
Search Places
Search across all indexed places, businesses, and addresses. When latitude and longitude are provided, results are ranked by a combination of text relevance and geographic proximity. Without coordinates, results are ranked by text relevance alone.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
q | string | Required | Search query for places, addresses, or businesses(e.g. pharmacie Nouakchott) |
latitude | number | Optional | Latitude for proximity-based ranking. Results closer to this point rank higher.(e.g. 18.0858) |
longitude | number | Optional | Longitude for proximity-based ranking. Must be provided with latitude.(e.g. -15.9785) |
limit | number | Optional | Maximum number of results (1-50, default: 10)(e.g. 10) |
language | string | Optional | Response language: fr, ar, or en(e.g. fr) |
Example Request
curl -X GET "https://api.oolel.com/search?q=pharmacie&latitude=18.0858&longitude=-15.9785&limit=5&language=fr" \
-H "Authorization: Bearer YOUR_API_KEY"Example Response
{
"results": [
{
"id": "addr_a1b2c3d4",
"name": "Pharmacie Centrale",
"formatted": "Pharmacie Centrale, Ave Gamal Abdel Nasser, Tevragh Zeina, Nouakchott",
"latitude": 18.0862,
"longitude": -15.9781,
"distance": 52.3,
"type": "business",
"category": "pharmacy",
"components": {
"street": "Avenue Gamal Abdel Nasser",
"neighbourhood": "Tevragh Zeina",
"city": "Nouakchott",
"country": "Mauritania"
}
},
{
"id": "addr_e5f6g7h8",
"name": "Pharmacie Ibn Sina",
"formatted": "Pharmacie Ibn Sina, Ksar, Nouakchott",
"latitude": 18.0891,
"longitude": -15.9723,
"distance": 734.1,
"type": "business",
"category": "pharmacy",
"components": {
"neighbourhood": "Ksar",
"city": "Nouakchott",
"country": "Mauritania"
}
},
{
"id": "addr_i9j0k1l2",
"name": "Grande Pharmacie du Sahel",
"formatted": "Grande Pharmacie du Sahel, Ilot K, Nouakchott",
"latitude": 18.0795,
"longitude": -15.9692,
"distance": 1203.8,
"type": "business",
"category": "pharmacy",
"components": {
"neighbourhood": "Ilot K",
"city": "Nouakchott",
"country": "Mauritania"
}
}
],
"query": "pharmacie",
"totalResults": 3,
"limit": 5
}Search Tips
Proximity Ranking
Always provide latitude and longitude when the user's location is known. This significantly improves result relevance by weighting results that are geographically closer to the user.
Multilingual Queries
The search index includes French, Arabic, and English names. You can search in any language regardless of the language parameter. The language parameter only affects the response format.
Result Types
Results include a type field that can be "address", "business", "poi" (point of interest), or "admin" (administrative boundary). Use this to filter or group results in your UI.