-
Notifications
You must be signed in to change notification settings - Fork 38
API
Our API is very useful when you need other software to process the OSMCha data. Check some instructions on how to start using it.
Go to the Filters page, and fill the desired filter parameters to search for changesets. Apply the search to check the results. If it gave you the results that you wanted, save the filter.
Go to your OSMCha user page and copy your Token.
Open another tab in your browser, access https://osmcha.mapbox.com/api-docs/#!/aoi/aoi_changesets_list and
click on the Authorize button. Paste Token <the_token_code_you_copied_from_your_user_page>
and click on the authorize button.
Important: remember to add the word Token
before you token value.
Go back to the other OSMCha tab and copy the id
of the filter that you saved
(it's available on the tab URL or on the Saved Filters section of your user page.
Paste it in the id
field of the get /api/v1/aoi/{id}/
section.
The response will be a GeoJSON, containing the BBOX of the changeset and all metadata we have registered on our database.
Note: saving a filter is the easiest way to make that API query, but if you want, you can pass the filters params directly to the changesets endpoint (https://osmcha.mapbox.com/api-docs/#!/changesets/changesets_list).
To navigate through the results page, add the page
param. And to define the number of changesets returned on each page, add the page_size
param. For example: ?page=2&page_size=30
.
- curl
curl -X GET --header 'Accept: application/json' --header 'Authorization: Token <your-token>' 'https://osmcha.mapbox.com/api/v1/aoi/<aoi_id>/changesets/'
Note: the word Token
needs to be present in the Authorization
header, otherwise it will not work.