Download OpenAPI specification:Download
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.wellpack.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 analyze areas: 1 call = 1 area = 1 credit.
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 analyse areas, 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 areas:
The endpoint /area_analysis lets you analyze a single new area. This endpoint is asynchronous; when submitting your inputs, the API immediately returns an ID. You can then query the API with this ID to check the analysis processing state and retrieve the output when done.
MY_ID = requests.post(
'https://api.wellpack.seiki.co/v1/area_analysis',
headers = {'key': MY_API_KEY},
json = {
"period_start": "2024-12-01",
"period_end": "2024-12-31",
"method": {
"include_or_exclude_buffer": None,
"limit_pop": 0.8
},
"target": {
"trip_purpose": None,
"modes": [
"VEHICULES", "MODES_DOUX"
],
"frequency_min": 10,
"frequency_max": 12,
"genders": None,
"ages": ["20-24", "25-29", "30-34"],
"socio_professional_categories": [
"CSP_PLUS"
]
},
"geometries": [
{
"coordinates": [
[
[2.313427004839639, 48.877268699116286],
[2.3134507995291074, 48.87707178022791],
[2.3147852850287336, 48.877121336047594],
[2.3147733876846246, 48.87731564655172],
[2.313427004839639, 48.877268699116286]
]
],
"type": "Polygon"
}
]
}
).json()["id"]
To retrieve the state and/or output of your id, you can use the following code:
requests.get(
'https://api.wellpack.seiki.co/v1/area_analysis/' + MY_ID,
headers = {'key': MY_API_KEY}
)
The output contains all information on the area, including the generated ID and its data.
To wait until a job is done, you can use the following code:
import time
import requests
status_code = 202
while status_code == 202:
time.sleep(5) # Wait 5 seconds
response = requests.get(
'https://api.wellpack.seiki.co/v1/area_analysis/' + MY_ID,
headers = {'key': MY_API_KEY}
)
status_code = response.status_code
print(response.json())
The results of the area analysis remain available for 48 hours after 'the post', after this period it will no longer be possible to retrieve the data.
This route allows you to compute a single new area analysis, in an asynchronous way. The area can be described as a list of POI(s) or Zone(s), and is represented by a geometry in GeoJSON format.
Costs 1 credit.
| dry_run | boolean Default: false Perform a dry run: only checks authorization and parameters, at no credit cost |
| period_start | string or null <date> Default: "2024-01-01" The start date of the analysis |
| period_end | string or null <date> Default: "2024-12-31" The end date of the analysis |
object | |
object | |
Array of objects List (which can be a single item) of POI(s) or ZONE(s) (geometry GeoJSON format) of interest to be analyzed |
{- "period_start": "2024-09-28",
- "period_end": "2024-10-14",
- "method": {
- "include_or_exclude_buffer": -500,
- "limit_pop": 0.8
}, - "target": {
- "trip_purpose": [
- "TRAVAIL | DOMICILE | ETUDE | TOURISME | RESTAURATION | SPORT_LOISIR_CULTURE_RELIGION | ACHAT | SOIN | ACCOMPAGNEMENT"
], - "modes": [
- "MODES_DOUX | VEHICULES"
], - "frequency_min": 10,
- "frequency_max": 20,
- "genders": [
- "MALE | FEMALE"
], - "ages": [
- "15-19 | 20-24 | 25-29 | 30-34 | 35-39 | 40-44 | 45-49 | 50-54 | 55-59 | 60-64 | 65-PLUS"
], - "socio_professional_categories": [
- "INACTIFS | RETRAITES | CSP_MOINS | CSP_PLUS"
]
}, - "geometries": [
- {
- "type": "Polygon | Point",
- "coordinates": [
- [
- 0.1
]
]
}
]
}{- "consumed_credits": 1,
- "id": "03ba5aac-7b56-4f37-96a9-c21b5a6fd20c"
}| id required | string The ID of the location job |
requests.get( 'https://api.wellpack.seiki.co/v1/area_analysis/<id>', headers = { 'key': MY_API_KEY } )
{- "state": "FAILURE | RUNNING | SUCCESS",
- "cost": 1,
- "refund": 0,
- "items": {
- "data": {
- "nbr_iris": 31,
- "breakdowns": {
- "day": {
- "lundi": 0.1,
- "mardi": 0.1,
- "mercredi": 0.1,
- "jeudi": 0.1,
- "vendredi": 0.1,
- "samedi": 0.1,
- "dimanche": 0.1
}, - "day_hour": {
- "lundi": {
- "0": 0.1,
- "1": 0.1,
- "2": 0.1,
- "3": 0.1,
- "4": 0.1,
- "5": 0.1,
- "6": 0.1,
- "7": 0.1,
- "8": 0.1,
- "9": 0.1,
- "10": 0.1,
- "11": 0.1,
- "12": 0.1,
- "13": 0.1,
- "14": 0.1,
- "15": 0.1,
- "16": 0.1,
- "17": 0.1,
- "18": 0.1,
- "19": 0.1,
- "20": 0.1,
- "21": 0.1,
- "22": 0.1,
- "23": 0.1
}, - "mardi": {
- "0": 0.1,
- "1": 0.1,
- "2": 0.1,
- "3": 0.1,
- "4": 0.1,
- "5": 0.1,
- "6": 0.1,
- "7": 0.1,
- "8": 0.1,
- "9": 0.1,
- "10": 0.1,
- "11": 0.1,
- "12": 0.1,
- "13": 0.1,
- "14": 0.1,
- "15": 0.1,
- "16": 0.1,
- "17": 0.1,
- "18": 0.1,
- "19": 0.1,
- "20": 0.1,
- "21": 0.1,
- "22": 0.1,
- "23": 0.1
}, - "mercredi": {
- "0": 0.1,
- "1": 0.1,
- "2": 0.1,
- "3": 0.1,
- "4": 0.1,
- "5": 0.1,
- "6": 0.1,
- "7": 0.1,
- "8": 0.1,
- "9": 0.1,
- "10": 0.1,
- "11": 0.1,
- "12": 0.1,
- "13": 0.1,
- "14": 0.1,
- "15": 0.1,
- "16": 0.1,
- "17": 0.1,
- "18": 0.1,
- "19": 0.1,
- "20": 0.1,
- "21": 0.1,
- "22": 0.1,
- "23": 0.1
}, - "jeudi": {
- "0": 0.1,
- "1": 0.1,
- "2": 0.1,
- "3": 0.1,
- "4": 0.1,
- "5": 0.1,
- "6": 0.1,
- "7": 0.1,
- "8": 0.1,
- "9": 0.1,
- "10": 0.1,
- "11": 0.1,
- "12": 0.1,
- "13": 0.1,
- "14": 0.1,
- "15": 0.1,
- "16": 0.1,
- "17": 0.1,
- "18": 0.1,
- "19": 0.1,
- "20": 0.1,
- "21": 0.1,
- "22": 0.1,
- "23": 0.1
}, - "vendredi": {
- "0": 0.1,
- "1": 0.1,
- "2": 0.1,
- "3": 0.1,
- "4": 0.1,
- "5": 0.1,
- "6": 0.1,
- "7": 0.1,
- "8": 0.1,
- "9": 0.1,
- "10": 0.1,
- "11": 0.1,
- "12": 0.1,
- "13": 0.1,
- "14": 0.1,
- "15": 0.1,
- "16": 0.1,
- "17": 0.1,
- "18": 0.1,
- "19": 0.1,
- "20": 0.1,
- "21": 0.1,
- "22": 0.1,
- "23": 0.1
}, - "samedi": {
- "0": 0.1,
- "1": 0.1,
- "2": 0.1,
- "3": 0.1,
- "4": 0.1,
- "5": 0.1,
- "6": 0.1,
- "7": 0.1,
- "8": 0.1,
- "9": 0.1,
- "10": 0.1,
- "11": 0.1,
- "12": 0.1,
- "13": 0.1,
- "14": 0.1,
- "15": 0.1,
- "16": 0.1,
- "17": 0.1,
- "18": 0.1,
- "19": 0.1,
- "20": 0.1,
- "21": 0.1,
- "22": 0.1,
- "23": 0.1
}, - "dimanche": {
- "0": 0.1,
- "1": 0.1,
- "2": 0.1,
- "3": 0.1,
- "4": 0.1,
- "5": 0.1,
- "6": 0.1,
- "7": 0.1,
- "8": 0.1,
- "9": 0.1,
- "10": 0.1,
- "11": 0.1,
- "12": 0.1,
- "13": 0.1,
- "14": 0.1,
- "15": 0.1,
- "16": 0.1,
- "17": 0.1,
- "18": 0.1,
- "19": 0.1,
- "20": 0.1,
- "21": 0.1,
- "22": 0.1,
- "23": 0.1
}
}, - "hour": {
- "0": 0.1,
- "1": 0.1,
- "2": 0.1,
- "3": 0.1,
- "4": 0.1,
- "5": 0.1,
- "6": 0.1,
- "7": 0.1,
- "8": 0.1,
- "9": 0.1,
- "10": 0.1,
- "11": 0.1,
- "12": 0.1,
- "13": 0.1,
- "14": 0.1,
- "15": 0.1,
- "16": 0.1,
- "17": 0.1,
- "18": 0.1,
- "19": 0.1,
- "20": 0.1,
- "21": 0.1,
- "22": 0.1,
- "23": 0.1
}, - "trip_purpose": {
- "TRAVAIL": 0.1,
- "DOMICILE": 0.1,
- "ETUDE": 0.1,
- "TOURISME": 0.1,
- "RESTAURATION": 0.1,
- "SPORT_LOISIR_CULTURE_RELIGION": 0.1,
- "ACHAT": 0.1,
- "SOIN": 0.1,
- "ACCOMPAGNEMENT": 0.1
}, - "mode": {
- "MODES_DOUX": 0.1,
- "VEHICULES": 0.1
}, - "socio_demography": {
- "gender": {
- "MALE": 0.1,
- "FEMALE": 0.1
}, - "age": {
- "15-19": 0.1,
- "20-24": 0.1,
- "25-29": 0.1,
- "30-34": 0.1,
- "35-39": 0.1,
- "40-44": 0.1,
- "45-49": 0.1,
- "50-54": 0.1,
- "55-59": 0.1,
- "60-64": 0.1,
- "65-PLUS": 0.1
}, - "socio_professional_categories": {
- "CSP_PLUS": 0.1,
- "CSP_MOINS": 0.1,
- "INACTIFS": 0.1,
- "RETRAITES": 0.1
}
}
}, - "iris_origins": [
- {
- "code": "string",
- "name": "string",
- "rank": 0,
- "breakdown": 0.1,
- "socio_demography_breakdown": {
- "gender": {
- "MALE": 0.1,
- "FEMALE": 0.1
}, - "age": {
- "15-19": 0.1,
- "20-24": 0.1,
- "25-29": 0.1,
- "30-34": 0.1,
- "35-39": 0.1,
- "40-44": 0.1,
- "45-49": 0.1,
- "50-54": 0.1,
- "55-59": 0.1,
- "60-64": 0.1,
- "65-PLUS": 0.1
}, - "socio_professional_categories": {
- "CSP_PLUS": 0.1,
- "CSP_MOINS": 0.1,
- "INACTIFS": 0.1,
- "RETRAITES": 0.1
}
}
}
]
}, - "input": {
- "period_start": "2024-09-28",
- "period_end": "2024-10-30",
- "method": {
- "include_or_exclude_buffer": -500,
- "limit_pop": 0.8
}, - "target": {
- "trip_purpose": [
- [
- "TRAVAIL",
- "DOMICILE",
- "ETUDE",
- "TOURISME",
- "RESTAURATION",
- "SPORT_LOISIR_CULTURE_RELIGION",
- "ACHAT",
- "SOIN",
- "ACCOMPAGNEMENT"
]
], - "modes": [
- [
- "MODES_DOUX",
- "VEHICULES"
]
], - "frequency_min": 10,
- "frequency_max": "20l",
- "genders": [
- [
- "MALE",
- "FEMALE"
]
], - "ages": [
- [
- "15-19",
- "20-24",
- "25-29",
- "30-34",
- "35-39",
- "40-44",
- "45-49",
- "50-54",
- "55-59",
- "60-64",
- "65-PLUS"
]
], - "socio_professional_categories": [
- "INACTIFS | RETRAITES | CSP_MOINS | CSP_PLUS"
]
}, - "geometry": [
- {
- "type": "Polygon",
- "coordinates": [
- [
- [
- 0.1
]
]
]
}
]
}
}
}{- "items": [
- {
- "id": "15-19",
- "label": "15 à 19 ans"
}, - {
- "id": "20-24",
- "label": "20 à 24 ans"
}, - {
- "id": "25-29",
- "label": "25 à 29 ans"
}, - {
- "id": "30-34",
- "label": "30 à 34 ans"
}, - {
- "id": "35-39",
- "label": "35 à 39 ans"
}, - {
- "id": "40-44",
- "label": "40 à 44 ans"
}, - {
- "id": "45-49",
- "label": "45 à 49 ans"
}, - {
- "id": "50-54",
- "label": "50 à 54 ans"
}, - {
- "id": "55-59",
- "label": "55 à 59 ans"
}, - {
- "id": "60-64",
- "label": "60 à 64 ans"
}, - {
- "id": "65-PLUS",
- "label": "65 ans et plus"
}
]
}{- "items": [
- {
- "id": "CSP_PLUS",
- "label": "Personnes exerçant des professions à hauts revenus et responsabilités"
}, - {
- "id": "CSP_MOINS",
- "label": "Personnes exerçant des professions à faibles revenus ou qualifications"
}, - {
- "id": "INACTIFS",
- "label": "Personnes sans activité professionnelle"
}, - {
- "id": "RETRAITES",
- "label": "Personnes Retraités"
}
]
}{- "items": [
- {
- "id": "TRAVAIL",
- "label": "Travail"
}, - {
- "id": "DOMICILE",
- "label": "Domicile"
}, - {
- "id": "ETUDE",
- "label": "Étude"
}, - {
- "id": "DOMICILE",
- "label": "Domicile"
}, - {
- "id": "TOURISME",
- "label": "Tourisme"
}, - {
- "id": "RESTAURATION",
- "label": "Restauration"
}, - {
- "id": "SPORT_LOISIR_CULTURE_RELIGION",
- "label": "Sport, loisir, culture, religion"
}, - {
- "id": "ACHAT",
- "label": "Achat"
}, - {
- "id": "SOIN",
- "label": "Soin"
}, - {
- "id": "ACCOMPAGNEMENT",
- "label": "Accompagnement"
}
]
}