Download OpenAPI specification:Download
This API lets you create and manage your POIs. You can then perform various analysis on your POIs.
The creation of new POIs consumes credits, however all subsequent analyses on these POIs are free.
To call this API you need an API key provided by Seiki. The API key is provided in every HTTP call in the key header.
Here is an example in Python :
requests.get(
'https://api.seiki.co/v1/account/credits',
headers = {'key': MY_API_KEY}
)
In case of failed authentication, the API returns the following status codes :
To use this API, you need credits in order to create new POIs : 1 POI = 1 credit Once a POI is created, you can then access access its data at no cost.
To retrieve your amount of credits, you can call the endpoint /account/credits
In case of insufficient credits, the API returns a status code 402.
For the endpoints that create POIs, the optional boolean parameter dry_run can be provided, which allows you to check authentication and parameters validity at no cost. It also allows you to retrieve what would be the cost of the computation.
Here's the workflow when you create POIs :
The endpoint /poi lets you create a single new POI. This endpoint is synchronous, which means that your client will wait for the API to answer. You can either create a POI by its latitude / longitude, or by its address :
requests.post(
'https://api.seiki.co/v1/poi',
headers = { 'key': MY_API_KEY },
json = { 'lat': 48.8751, 'lng': 2.3074 }
).json()
requests.post(
'https://api.seiki.co/v1/poi',
headers = { 'key': MY_API_KEY },
json = { 'address': '178 bd Haussmann Paris' }
).json()
The output contains all information on the POI, including the generated POI id and its data.
You can list all your POIs with the following call :
requests.get(
'https://api.seiki.co/v1/poi',
headers = { 'key': MY_API_KEY }
).json()
You can also filter this list by multiple parameters : id, tag, or location. The filters can also be lists that contain mulitple values. The following call retrieves all POIs with the tag 'MY_SHOPS', which are in the departments 75 and 91
requests.get(
'https://api.seiki.co/v1/poi',
headers = { 'key': MY_API_KEY },
params = { 'tag': 'MY_SHOPS', 'fr_departement': [ '75', '91' ] }
).json()
You can create multiple POIs at once, using the asynchronous endpoint /poi/batch. When submitting your inputs, the API immediately returns a batch id. You can then query the API with this batch id, to check the batch processing state, and retrieve the output when done.
Here's an example submitting a new batch :
body = {
'items': [
{ 'lat': 48.8751, 'lng': 2.3074 },
{ 'address': '178 bd Haussmann' }
]}
MY_BATCH_ID = requests.post(
'https://api.seiki.co/v1/poi/batch',
headers = { 'key': MY_API_KEY },
json = body
).json()['batch_id']
To retrieve the state and/or output of a batch, you can use the following code :
requests.get(
'https://api.seiki.co/v1/batch/' + MY_BATCH_ID,
headers = { 'key': MY_API_KEY }
)
To wait until a job is done, you can use the following code :
status_code = 202
while status_code == 202:
time.sleep(5) # Wait 5 seconds
output = requests.get(
'https://api.seiki.co/v1/batch/' + MY_BATCH_ID,
headers = { 'key': MY_API_KEY }
)
status_code = output.status_code
print(output.json())
After your POIs are created, you can perform multiple analyses on these POIs, using a single endpoint : /poi/analysis
This call returns all available data on all POIs :
requests.post(
'https://api.seiki.co/v1/poi/analysis',
headers = { 'key': MY_API_KEY }
)
You can apply filters on the set of POIs, the same way as when listing POIs (/poi) :
requests.post(
'https://api.seiki.co/v1/poi/analysis',
headers = { 'key': MY_API_KEY },
params = { 'id': MY_POI_ID }
)
You can also choose a subset of returned KPIs :
requests.post(
'https://api.seiki.co/v1/poi/analysis',
headers = { 'key': MY_API_KEY },
params = { 'id': MY_POI_ID, 'kpi': [ 'section', 'traffic.people_in_a_day' ] }
)
You can also filter data itself on several parameters. The following call returns the average total number of male people passing by the POI between 8 and 11 AM, on a working day :
requests.post(
'https://api.seiki.co/v1/poi/analysis',
headers = { 'key': MY_API_KEY },
params = { 'id': MY_POI_ID, 'kpi': [ 'traffic.people_in_a_day.total' ] },
json = { 'day_type': 'WORKING_DAYS', 'gender': 'MALE', 'hour': [ 8, 9, 10 ] }
)
This route allows you to compute a single new POI, in a synchronous way. The POI can be described either by its coordinates (WGS84), or by an address : you cannot provide both. Beware that providing an address can result in an imprecision on the exact location.
The coordinates (48.8751, 2.3074) are free
Costs 1 credit
| dry_run | boolean Default: false Perform a dry run : only checks authorization and parameters, at no credit cost |
| address | string Full address |
| lat | number <float> Latitude in WGS84 format |
| lng | number <float> Longitude in WGS84 format |
| label | string Optional friendly name of the POI |
| tags | Array of strings Optional tags to apply to the POI |
{- "address": null,
- "lat": 48.8751,
- "lng": 2.3074,
- "label": "My store",
- "tags": [
- "my-poi-set"
]
}{- "consumed_credits": 1,
- "items": [
- {
- "id": "8b4fec48-04a0-4025-b147-3db4c0643c83",
- "label": "My store",
- "address": "178 bd Haussmann 75008 Paris",
- "lat": 48.87,
- "lng": 2.3,
- "ts_created": "2023-09-15T13:49:52.613040Z",
- "ts_updated": "2023-09-15T13:50:11.295282Z",
- "error": null,
- "state": "SUCCESS",
- "is_from_cache": true,
- "tags": [
- "string"
], - "data": {
- "section": {
- "name": "string",
- "geography": {
- "fr_region": {
- "id": "string",
- "label": "string"
}, - "fr_departement": {
- "id": "string",
- "label": "string"
}, - "fr_commune": {
- "id": "string",
- "label": "string"
}, - "fr_iris": {
- "id": "string",
- "label": "string"
}
}, - "length_m": 0.1,
- "number_directions": 0,
- "max_speed_kph": 0.1,
- "avg_speed_kph": 0.1,
- "geometry": "string"
}, - "traffic": {
- "crossings_in_a_day": {
- "total": 0.1,
- "week_ratio": {
- "property1": 0.1,
- "property2": 0.1
}, - "day_type_ratio": {
- "property1": 0.1,
- "property2": 0.1
}, - "hour_breakdown": {
- "property1": 0.1,
- "property2": 0.1
}, - "mode_breakdown": {
- "property1": 0.1,
- "property2": 0.1
}, - "gender_breakdown": {
- "property1": 0.1,
- "property2": 0.1
}, - "age_breakdown": {
- "property1": 0.1,
- "property2": 0.1
}, - "social_group_breakdown": {
- "property1": 0.1,
- "property2": 0.1
}, - "trip_purpose_breakdown": {
- "property1": 0.1,
- "property2": 0.1
}
}, - "people_in_a_day": {
- "total": 0.1,
- "week_ratio": {
- "property1": 0.1,
- "property2": 0.1
}, - "day_type_ratio": {
- "property1": 0.1,
- "property2": 0.1
}, - "hour_breakdown": {
- "property1": 0.1,
- "property2": 0.1
}, - "mode_breakdown": {
- "property1": 0.1,
- "property2": 0.1
}, - "gender_breakdown": {
- "property1": 0.1,
- "property2": 0.1
}, - "age_breakdown": {
- "property1": 0.1,
- "property2": 0.1
}, - "social_group_breakdown": {
- "property1": 0.1,
- "property2": 0.1
}, - "trip_purpose_breakdown": {
- "property1": 0.1,
- "property2": 0.1
}
}
}, - "origins": [
- {
- "property1": 0.1,
- "property2": 0.1
}
]
}
}
]
}limit 1000
| id | Array of strings Identifiers of the resources |
| tag | Array of strings Tags of the resources |
| fr_region | Array of strings Identifier of 'region' in zone FR |
| fr_departement | Array of strings Identifier of 'departement' in zone FR |
| fr_commune | Array of strings Identifier of 'commune' in zone FR |
| success_only | boolean Default: false Only return items successfully computed |
requests.get( 'https://api.seiki.co/v1/poi', headers = { 'key': MY_API_KEY } )
{- "items": [
- {
- "id": "8b4fec48-04a0-4025-b147-3db4c0643c83",
- "label": "My store",
- "address": "178 bd Haussmann 75008 Paris",
- "lat": 48.87,
- "lng": 2.3,
- "ts_created": "2023-09-15T13:49:52.613040Z",
- "ts_updated": "2023-09-15T13:50:11.295282Z",
- "error": null,
- "state": "SUCCESS",
- "is_from_cache": true,
- "tags": [
- "string"
]
}
]
}This route allows you to compute a batch of new POIs, described by their coordinates or addresses. The route is asynchronous : it returns a batch id that can be queried subsequently. Beware that using addresses can result in imprecisions on the exact locations of the POIs.
Costs 1 credit per POI
| dry_run | boolean Default: false Perform a dry run : only checks authorization and parameters, at no credit cost |
Array of objects | |
| tags | Array of strings |
{- "items": [
- {
- "address": "178 bd Haussmann 75008 Paris",
- "lat": 48.87,
- "lng": 2.3,
- "label": "My store"
}
], - "tags": [
- "string"
]
}{- "consumed_credits": 1,
- "batch_id": "077d5c56-d25f-4d7f-a08e-24a935f55895"
}This route allows you to retrieve the state and output of a batch (if completed)
The status code can be used to check the job progression : 200 if done, 202 if still running
| include_data | boolean Default: true Return all data for each item |
requests.get( 'https://api.seiki.co/v1/batch/MY_BATCH_ID', headers = {'key': MY_API_KEY} )
{- "state": "SUCCESS | FAILURE",
- "cost": 2,
- "refund": 1,
- "error": "string",
- "items": [
- {
- "id": "8b4fec48-04a0-4025-b147-3db4c0643c83",
- "label": "My store",
- "address": "178 bd Haussmann 75008 Paris",
- "lat": 48.87,
- "lng": 2.3,
- "ts_created": "2023-09-15T13:49:52.613040Z",
- "ts_updated": "2023-09-15T13:50:11.295282Z",
- "error": null,
- "state": "SUCCESS",
- "is_from_cache": true,
- "tags": [
- "string"
]
}
]
}limit 1000
| id | Array of strings Identifiers of the resources |
| tag | Array of strings Tags of the resources |
| fr_region | Array of strings Identifier of 'region' in zone FR |
| fr_departement | Array of strings Identifier of 'departement' in zone FR |
| fr_commune | Array of strings Identifier of 'commune' in zone FR |
| kpi | Array of strings Selected KPIs |
number or Array of numbers | |
string or Array of strings | |
number or Array of numbers | |
string or Array of strings | |
string or Array of strings | |
string or Array of strings | |
string or Array of strings | |
string or Array of strings |
{- "week": 0,
- "day_type": "string",
- "hour": 0,
- "mode": "string",
- "gender": "string",
- "age": "string",
- "social_group": "string",
- "trip_purpose": "string"
}{- "items": [
- {
- "id": "8b4fec48-04a0-4025-b147-3db4c0643c83",
- "label": "My store",
- "address": "178 bd Haussmann 75008 Paris",
- "lat": 48.87,
- "lng": 2.3,
- "ts_created": "2023-09-15T13:49:52.613040Z",
- "ts_updated": "2023-09-15T13:50:11.295282Z",
- "error": null,
- "state": "SUCCESS",
- "is_from_cache": true,
- "tags": [
- "string"
], - "data": {
- "section": {
- "name": "string",
- "geography": {
- "fr_region": {
- "id": "string",
- "label": "string"
}, - "fr_departement": {
- "id": "string",
- "label": "string"
}, - "fr_commune": {
- "id": "string",
- "label": "string"
}, - "fr_iris": {
- "id": "string",
- "label": "string"
}
}, - "length_m": 0.1,
- "number_directions": 0,
- "max_speed_kph": 0.1,
- "avg_speed_kph": 0.1,
- "geometry": "string"
}, - "traffic": {
- "crossings_in_a_day": {
- "total": 0.1,
- "week_ratio": {
- "property1": 0.1,
- "property2": 0.1
}, - "day_type_ratio": {
- "property1": 0.1,
- "property2": 0.1
}, - "hour_breakdown": {
- "property1": 0.1,
- "property2": 0.1
}, - "mode_breakdown": {
- "property1": 0.1,
- "property2": 0.1
}, - "gender_breakdown": {
- "property1": 0.1,
- "property2": 0.1
}, - "age_breakdown": {
- "property1": 0.1,
- "property2": 0.1
}, - "social_group_breakdown": {
- "property1": 0.1,
- "property2": 0.1
}, - "trip_purpose_breakdown": {
- "property1": 0.1,
- "property2": 0.1
}
}, - "people_in_a_day": {
- "total": 0.1,
- "week_ratio": {
- "property1": 0.1,
- "property2": 0.1
}, - "day_type_ratio": {
- "property1": 0.1,
- "property2": 0.1
}, - "hour_breakdown": {
- "property1": 0.1,
- "property2": 0.1
}, - "mode_breakdown": {
- "property1": 0.1,
- "property2": 0.1
}, - "gender_breakdown": {
- "property1": 0.1,
- "property2": 0.1
}, - "age_breakdown": {
- "property1": 0.1,
- "property2": 0.1
}, - "social_group_breakdown": {
- "property1": 0.1,
- "property2": 0.1
}, - "trip_purpose_breakdown": {
- "property1": 0.1,
- "property2": 0.1
}
}
}, - "origins": [
- {
- "property1": 0.1,
- "property2": 0.1
}
]
}
}
]
}{- "items": [
- {
- "id": "15-24",
- "label": "15 à 24 ans"
}, - {
- "id": "25-34",
- "label": "25 à 34 ans"
}, - {
- "id": "35-49",
- "label": "35 à 49 ans"
}, - {
- "id": "50-64",
- "label": "50 à 64 ans"
}, - {
- "id": "65-PLUS",
- "label": "65 ans et +"
}
]
}{- "items": [
- {
- "id": "DOMICILE",
- "label": "Domicile"
}, - {
- "id": "TRAVAIL",
- "label": "Travail"
}, - {
- "id": "TOURISME",
- "label": "Tourisme"
}, - {
- "id": "ACHATS",
- "label": "Achats"
}, - {
- "id": "EDUCATION",
- "label": "Education"
}, - {
- "id": "SPORT_CULTURE_LOISIR_RELIGION",
- "label": "Sport, culture, loisirs, religion"
}, - {
- "id": "AUTRES",
- "label": "Autres"
}
]
}{- "items": [
- {
- "id": "N",
- "label": "Nord"
}, - {
- "id": "NE",
- "label": "Nord Est"
}, - {
- "id": "E",
- "label": "Est"
}, - {
- "id": "SE",
- "label": "Sud Est"
}, - {
- "id": "S",
- "label": "Sud"
}, - {
- "id": "SO",
- "label": "Sud Ouest"
}, - {
- "id": "O",
- "label": "Ouest"
}, - {
- "id": "NO",
- "label": "Nord Ouest"
}
]
}