Lieux
Commerces et lieux autour d’un point, par texte, et le détail d’un lieu.
Envoyez votre clé avec key=VOTRE_CLE_API dans l’adresse, ou dans l’en-tête X-NWays-Api-Key. Clés d’API
Adresse de base : https://nways.ng/maps/v1
Commerces et lieux près d’un point
GET https://nways.ng/maps/v1/places/nearby
Par catégorie (classés par proximité et notoriété, 40 par page ; les listes de DAB et d’espèces placent d’abord les distributeurs qui paient) et/ou par nom. fields= fixe le SKU : champs de base (par défaut) search ; tout champ de contact places_contact ; tout champ d’ambiance places_atmosphere. Raisons : LAT_LNG_REQUIRED, CATEGORY_INVALID, CATEGORY_OR_QUERY_REQUIRED, RADIUS_INVALID, PAGE_TOKEN_INVALID, FIELDS_INVALID.
Paramètres
| Nom | Où | Type | Description |
|---|---|---|---|
lat | requête | number | Obligatoire. |
lng | requête | number | Obligatoire. |
category | requête | string | Au choix: petrol, charging, food, fastfood, cafe, bar, pos, bank, atm, cash, mechanic, vulcanizer, carwash, police, hospital, pharmacy, hotel, supermarket, shop, market, motorpark, parking, church, mosque, phones, salon, school, office, attraction, estate, residential, government, university. |
q | requête | string | 60 caractères au plus. |
radius | requête | number | ≥ 200, ≤ 50000. |
limit | requête | integer | Par défaut: 40. ≥ 1, ≤ 40. |
pageToken | requête | string | |
fields | requête | string | De base (SKU search) : id, name, category, location, formattedAddress, plusCode, country, distanceM, businessStatus, attribution. Contact (places_contact) : phone, email, website, openingHours. Ambiance (places_atmosphere) : rating, amenities, details. Par défaut : de base. |
curl "https://nways.ng/maps/v1/places/nearby?lat=6.4474&lng=3.472" \
-H "X-NWays-Api-Key: VOTRE_CLE_API"const res = await fetch('https://nways.ng/maps/v1/places/nearby?lat=6.4474&lng=3.472', {
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.get(
"https://nways.ng/maps/v1/places/nearby?lat=6.4474&lng=3.472",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Réponse
Lieux
| Champ | Type | Description |
|---|---|---|
places | Place[] | Obligatoire. |
places[].id | string | Obligatoire. |
places[].name | string | |
places[].category | string | |
places[].location | Point | |
places[].location.type | string | Obligatoire. |
places[].location.coordinates | number[] | Obligatoire. [lng, lat] Au moins 2 éléments, au plus 2 éléments. |
places[].formattedAddress | string | |
places[].plusCode | string | |
places[].country | string | |
places[].distanceM | number | |
places[].businessStatus | string | Au choix: OPERATIONAL, UNVERIFIED, REPORTED_CLOSED. |
places[].attribution | string | |
places[].phone | string | Niveau Contact |
places[].email | string | Niveau Contact |
places[].website | string | Niveau Contact |
places[].openingHours | object | Niveau Contact |
places[].openingHours.text | string | Obligatoire. Syntaxe opening_hours d’OpenStreetMap |
places[].openingHours.source | string | Obligatoire. Au choix: listed, owner, brand, usual. |
places[].openingHours.confirmed | integer | |
places[].rating | object | Niveau Ambiance |
places[].rating.score | number | 1–5, lissée |
places[].rating.count | integer | |
places[].rating.percentUp | integer | |
places[].rating.reviewCount | integer | |
places[].amenities | object | Niveau Ambiance : ce que le lieu propose, sous forme de balises OpenStreetMap (payment:*, wheelchair, delivery…). |
places[].details | object | Niveau Ambiance : détails propres au secteur d’activité. |
nextPageToken | string | |
attribution | string | Obligatoire. |
{
"places": [
{
"id": "osm:n2987189855",
"name": "Shoprite",
"category": "supermarket",
"location": {
"type": "string",
"coordinates": [
0
]
},
"formattedAddress": "string",
"plusCode": "string",
"country": "string",
"distanceM": 0,
"businessStatus": "OPERATIONAL",
"attribution": "string",
"phone": "string",
"email": "string",
"website": "string",
"openingHours": {
"text": "Mo-Su 09:00-21:00",
"source": "listed",
"confirmed": 0
},
"rating": {
"score": 0,
"count": 0,
"percentUp": 0,
"reviewCount": 0
},
"amenities": {},
"details": {}
}
],
"nextPageToken": "string",
"attribution": "string"
}Erreurs
defaultErreur
Commerces et lieux par texte
GET https://nways.ng/maps/v1/places/search
« Zenith Bank Ikeja », « pharmacie près de Yaba ». SKU comme pour /places/nearby. Raisons : comme /geocode, plus RADIUS_INVALID, FIELDS_INVALID.
Paramètres
| Nom | Où | Type | Description |
|---|---|---|---|
q | requête | string | Obligatoire. |
near | requête | string | lat,lng : classer et choisir les résultats proches de ce point. |
radius | requête | number | Avec near. ≥ 200, ≤ 50000. |
country | requête | string | Liste séparée par des virgules parmi NG, GH, BJ, TG, GA, CI, LR, GN, SL, GW, SN, CM, BF, CV, GM. |
limit | requête | integer | Par défaut: 10. ≥ 1, ≤ 20. |
lang | requête | string | Au choix: en, fr, pt. Par défaut: en. |
fields | requête | string | De base (SKU search) : id, name, category, location, formattedAddress, plusCode, country, distanceM, businessStatus, attribution. Contact (places_contact) : phone, email, website, openingHours. Ambiance (places_atmosphere) : rating, amenities, details. Par défaut : de base. |
curl "https://nways.ng/maps/v1/places/search?q=pharmacy+Yaba" \
-H "X-NWays-Api-Key: VOTRE_CLE_API"const res = await fetch('https://nways.ng/maps/v1/places/search?q=pharmacy+Yaba', {
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.get(
"https://nways.ng/maps/v1/places/search?q=pharmacy+Yaba",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Réponse
Lieux
| Champ | Type | Description |
|---|---|---|
places | Place[] | Obligatoire. |
places[].id | string | Obligatoire. |
places[].name | string | |
places[].category | string | |
places[].location | Point | |
places[].location.type | string | Obligatoire. |
places[].location.coordinates | number[] | Obligatoire. [lng, lat] Au moins 2 éléments, au plus 2 éléments. |
places[].formattedAddress | string | |
places[].plusCode | string | |
places[].country | string | |
places[].distanceM | number | |
places[].businessStatus | string | Au choix: OPERATIONAL, UNVERIFIED, REPORTED_CLOSED. |
places[].attribution | string | |
places[].phone | string | Niveau Contact |
places[].email | string | Niveau Contact |
places[].website | string | Niveau Contact |
places[].openingHours | object | Niveau Contact |
places[].openingHours.text | string | Obligatoire. Syntaxe opening_hours d’OpenStreetMap |
places[].openingHours.source | string | Obligatoire. Au choix: listed, owner, brand, usual. |
places[].openingHours.confirmed | integer | |
places[].rating | object | Niveau Ambiance |
places[].rating.score | number | 1–5, lissée |
places[].rating.count | integer | |
places[].rating.percentUp | integer | |
places[].rating.reviewCount | integer | |
places[].amenities | object | Niveau Ambiance : ce que le lieu propose, sous forme de balises OpenStreetMap (payment:*, wheelchair, delivery…). |
places[].details | object | Niveau Ambiance : détails propres au secteur d’activité. |
nextPageToken | string | |
attribution | string | Obligatoire. |
{
"places": [
{
"id": "osm:n2987189855",
"name": "Shoprite",
"category": "supermarket",
"location": {
"type": "string",
"coordinates": [
0
]
},
"formattedAddress": "string",
"plusCode": "string",
"country": "string",
"distanceM": 0,
"businessStatus": "OPERATIONAL",
"attribution": "string",
"phone": "string",
"email": "string",
"website": "string",
"openingHours": {
"text": "Mo-Su 09:00-21:00",
"source": "listed",
"confirmed": 0
},
"rating": {
"score": 0,
"count": 0,
"percentUp": 0,
"reviewCount": 0
},
"amenities": {},
"details": {}
}
],
"nextPageToken": "string",
"attribution": "string"
}Erreurs
defaultErreur
Les détails d’un lieu
GET https://nways.ng/maps/v1/places/{id}
fields est obligatoire : les champs dont vous avez besoin (ils fixent le SKU), ou * pour tous (places_atmosphere). Raisons : PLACE_ID_INVALID, FIELDS_REQUIRED, FIELDS_INVALID, PLACE_NOT_FOUND.
Paramètres
| Nom | Où | Type | Description |
|---|---|---|---|
id | chemin | string | Obligatoire. |
fields | requête | string | Obligatoire. |
curl "https://nways.ng/maps/v1/places/osm%3An2987189855?fields=name%2Clocation%2Cphone%2CopeningHours" \
-H "X-NWays-Api-Key: VOTRE_CLE_API"const res = await fetch('https://nways.ng/maps/v1/places/osm%3An2987189855?fields=name%2Clocation%2Cphone%2CopeningHours', {
headers: { 'X-NWays-Api-Key': process.env.NWAYS_API_KEY },
})
const data = await res.json()import os
import requests
res = requests.get(
"https://nways.ng/maps/v1/places/osm%3An2987189855?fields=name%2Clocation%2Cphone%2CopeningHours",
headers={"X-NWays-Api-Key": os.environ["NWAYS_API_KEY"]},
timeout=10,
)
data = res.json()Réponse
Le lieu
| Champ | Type | Description |
|---|---|---|
id | string | Obligatoire. |
name | string | |
category | string | |
location | Point | |
location.type | string | Obligatoire. |
location.coordinates | number[] | Obligatoire. [lng, lat] Au moins 2 éléments, au plus 2 éléments. |
formattedAddress | string | |
plusCode | string | |
country | string | |
distanceM | number | |
businessStatus | string | Au choix: OPERATIONAL, UNVERIFIED, REPORTED_CLOSED. |
attribution | string | |
phone | string | Niveau Contact |
email | string | Niveau Contact |
website | string | Niveau Contact |
openingHours | object | Niveau Contact |
openingHours.text | string | Obligatoire. Syntaxe opening_hours d’OpenStreetMap |
openingHours.source | string | Obligatoire. Au choix: listed, owner, brand, usual. |
openingHours.confirmed | integer | |
rating | object | Niveau Ambiance |
rating.score | number | 1–5, lissée |
rating.count | integer | |
rating.percentUp | integer | |
rating.reviewCount | integer | |
amenities | object | Niveau Ambiance : ce que le lieu propose, sous forme de balises OpenStreetMap (payment:*, wheelchair, delivery…). |
details | object | Niveau Ambiance : détails propres au secteur d’activité. |
{
"id": "osm:n2987189855",
"name": "Shoprite",
"category": "supermarket",
"location": {
"type": "string",
"coordinates": [
0
]
},
"formattedAddress": "string",
"plusCode": "string",
"country": "string",
"distanceM": 0,
"businessStatus": "OPERATIONAL",
"attribution": "string",
"phone": "string",
"email": "string",
"website": "string",
"openingHours": {
"text": "Mo-Su 09:00-21:00",
"source": "listed",
"confirmed": 0
},
"rating": {
"score": 0,
"count": 0,
"percentUp": 0,
"reviewCount": 0
},
"amenities": {},
"details": {}
}Erreurs
defaultErreur