Mapillary API v4 timeline - what is going on?

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.

Could we please have an update?

2 Likes

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:

  1. until when will API v3 continue functioning?
  2. what parts of API v3 will be limited once API v4 releases?
  3. where is the documentation for API v4?
  4. 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.

1 Like

Is there, or will there ever be a way to use the object tags ?
I did not find it in the API.

Commenting to also receive updates on API rollout

Thanks Chris. My main two questions are:

  • 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.

Just relaying here that the new API docs are available here: https://www.mapillary.com/developer/api-documentation/

1 Like

Hi

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?

Thanks

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)

Can’t figure out how to work with https://tiles.mapillary.com though.

I have tiles.mapillary.com set up for QGIS like this:
image

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

import math
def deg2num(lat_deg, lon_deg, zoom):
lat_rad = math.radians(lat_deg)
n = 2.0 ** zoom
xtile = int((lon_deg + 180.0) / 360.0 * n)
ytile = int((1.0 - math.asinh(math.tan(lat_rad)) / math.pi) / 2.0 * n)
return (xtile, ytile)

MAP_ACCESS_TOKEN = “MLY|xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”

z = 14
lat = 59.4368
lon = 24.7537

x,y = deg2num (lat, lon, z)

#uncomment the one layer you wish to use

#type=“mly1_computed_public”
#type=“mly_map_feature_point”
#type=“mly_map_feature_traffic_sign”
#type=“mly1_computed_public”
type=“mly1_public”

url = f"https://tiles.mapillary.com/maps/vtp/{type}/2/{z}/{x}/{y}?access_token={MAP_ACCESS_TOKEN}"

r = requests.get(url)
assert r.status_code == 200, r.content
vt_content = r.content
features = vt_bytes_to_geojson(vt_content, x, y, z)
print (features)

Sweet! That was very helpful!

There is mapbox_vector_tile that can decode the pbf into dictionary as well.

@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?

I want to see all emergencies in my AR glasses.

1 Like

Hi, I run into some problems about Detection API detection-api-in-v4
does anyone have similar problems with the Detection API?

Thanks.

Also not supported. But let’s see what the future brings. :slight_smile:

Am I correct in saying that line-geometry object detections (construction, line markings etc) are no longer available as of v4?

Another thing I’m confused about is how to get the IDs of map features. In the point vector tiles layer, the only attributes are:

  • “ID of the image”
  • value
  • first_seen_at
  • last_seen_at

Yet the map feature endpoint (https://graph.mapillary.com/:map_feature_id) takes a map feature ID.

Where does it come from? Is the image ID in the point layer actually a map feature?

(We track the map feature IDs in order to filter out ones that are assessed as not useful.)

Not sure if I’m doing something wrong, but the graph endpoint of the new API doesn’t seem to be returning any information for map features.

https://graph.mapillary.com/218855313114838?access_token=MLY|4156154957765752|f94ebf

This is just returning this JSON:

{
“id”: “218855313114838”
}

I don’t know what to make of that - is it a bad request? Server misbehaving?

Hi Steve,

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:

https://graph.mapillary.com/309498777295492?fields=first_seen_at,last_seen_at,object_value,object_type,geometry,images&access_token=MLY|4358850594197155|a12e79fbf1b784091dd47dea5f35f3ec

Thanks for thoroughly testing this.

Are you doing this in JavaScript, Python, something else?

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! :slight_smile:

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.