I recently built a site for a client that uses the Mapillary API for imagery and object detections (here), which I will need to update for the new API v4. According to the blog post on March 3:
v4 of the API would be launched in May
v3 would only be guaranteed to run until the end of May (or “several weeks” - it’s unclear)
developers should start using “the new v4 sandbox” (not linked) immediately to prepare for the change
“In the meantime, keep an eye on our blog, newsletter, and social media for further updates, examples, and details about the new Mapillary API.” (There have not been, afaik, any further updates on any of these channels. There hasn’t even been a newsletter since February, whereas previously there was one every month.)
This is fairly concerning.
First: the cutover timeline is incredibly short. Just “several weeks” to implement a completely new API before switching off the old one? A year or more would be typical.
Second: we are already past the date when the old API was supposedly going to be switched off, and there is still not even any documentation about the new API, no new timeline announced - complete radio silence.
Hi @stevage, I will get these questions answered on the blog ASAP.
To break it down, let me know if these questions are the ones that need addressing:
until when will API v3 continue functioning?
what parts of API v3 will be limited once API v4 releases?
where is the documentation for API v4?
when is API v4 released?
^ the best I can tell you is that API v4 will be available widely any day now, and I’m eager to get you started on it, we can have a live call to go over this too.
when does the API v4, with documentation, get released?
when does the API v3 get turned off?
The API v3 works just fine, so I don’t have any particular urgency. I just want to be able to do some planning for the upgrade so the site doesn’t suddenly break.
Does anyone have any examples using the v4 API yet?
I am not too familiar with OAuth2, does this require hosting an endpoint to receive a token? Or can this be done through requests only with a username/password?
Hi there - I have only managed to work with the graph endpoints. You don’t need to host your own endpoints - just use the client token from the dashboard.
Using request in python it looks something like this
url = 'https://graph.mapillary.com/image_ids?sequence_id=780170ac-64b2-4f12-8b41-06dfd83b39be'
data = dict()
headers = dict(Authorization="OAuth <client_token>")
x = requests.get(url, headers=headers)
data = x.json()['data']
print(data)
url = 'https://graph.mapillary.com/297238201933760?fields=id,computed_geometry,captured_at,thumb_2048_url'
x = requests.get(url, headers=headers)
data = x.json()
print(data)
Note that there is a space between OAuth and your actual token (e.g. OAuth MLY|ASBKGFLKSDGFJSHDGF)
No style URL yet, so everything looks the same. Other stuff (images, points etc) work the same way, just with different URLs. For downloading the data separately you have to calculate the tile numbers (like this) for your area and use those for z,x and y.
Here is a sample Python code for getting one tile as geoJSON:
import requests
from vt2geojson.tools import vt_bytes_to_geojson
@filipc this currently is still not supported. I assume your current use case for this is tagging defibrillators in the image? Can you explain the workflow you would want in entirety?
For the geometry of the detection, if you are working with Python, try using mapbox-vector-tile library to decode the geometry attribute of the detection (different from the geometry of the other data like images that has standard GeoJSON format). It is encoded as a vector tile so needs decoding to use.
For the map feature IDs: this is a typo in the docs! I will make moves for a fix. That is the ID of the map feature which is returned.
For your test API request, you need to specify the parameter fields= with the fields you want. So try:
For the geometry of the detection, if you are working with Python, try using mapbox-vector-tile library to decode the geometry attribute of the detection (different from the geometry of the other data like images that has standard GeoJSON format). It is encoded as a vector tile so needs decoding to use.
Sorry, I’m a bit confused - you’re saying that line features (construction zones and line markings in particular) are available in the tiles? But they have a non-standard encoding?
(I’m working in JavaScript, but I’m fairly comfortable working with vector tiles at that level if need be. Need a few more details though.)
For the map feature IDs: this is a typo in the docs! I will make moves for a fix. That is the ID of the map feature which is returned.
Thank god!
For your test API request, you need to specify the parameter fields= with the fields you want.
Thanks, makes sense. Suggest improving the docs to make this clearer within each entity. Yes, it’s spelt out at the “Entities” level, but if you search/skim to “Map feature” like I did, you would have no way of knowing this.
Hi Steve, sorry I misunderstood you–no, the line features are not available in the tiles, if referring to the lines we had in v3. But we do have point features that are lane marking and traffic signs for construction.