Invalid client id error

I signed up for an individual account and created a application. I am using the following code in jupyter notebook to pull images for a geo-coordinate.

I copied the client token from developer page and am using it. It’s of the following form:

MLY|22292192312312|xxxxdsadsdaufhdasx

However, when I run the code, I get an error: {'code': 'client_id_invalid', 'message': 'The provided client id is invalid'}

Full code:

import json, requests
from IPython.display import Image, display # import module to print an image

# set our building blocks
client_id = 'MLY|22292192312312|xxxxdsadsdaufhdasx' # client ID
coordinates = '-122.40347,37.780205' # the coordinates of our point of interest
distance = 15 # the maximum distance in meters that our image should be from the point it looks toward

# API call URL - we just want one image, and no pagination

url = ('https://a.mapillary.com/v3/images?client_id={}&per_page=1&lookat={}&closeto={}&radius={}').format(client_id,coordinates,coordinates,distance) 

# request a JSON showing the point location and metadata of the images looking at our coordinates
resp = requests.get(url)
data = resp.json()

print(data)

You are trying to access V3 API with V4 key. Since the keys are totally different, it won’t work. The old API is technically still up, but no new keys can be generated and it will probably shut down permanently.

I see, I modified the url string.

I get a response [200] when attempting to run the following code:

url = ('https://www.mapillary.com/images?client_id={}&per_page=1&lookat={}&closeto={}&radius={}').format(client_id,coordinates,coordinates,distance) 

Does v4 API not support the endpoints?

It’s different now - in order to get the image data, you have to query the tiles first to get the image ID and then query image data with that.

So, at first coverage tiles:
https://tiles.mapillary.com/maps/vtp/mly1_public/2/{z}/{x}/{y}?access_token=XXX

It’s up to you how to process that - find closest, newest within distance or something like that. Depends on the use case really. Anyway, once you find suitable id, you can get rest of the data from here:
https://graph.mapillary.com/:image_id, where fields=thumb_2048_url gives you the image.

Here is an example from Chris:
https://gist.github.com/cbeddow/79d68aa6ed0f028d8dbfdad2a4142cf5

Is there an endpoint to pull several images of a place in one call?

Not as far I can tell - the main element is the image id and all other data (including the visual representation itself) is under that. So there is no server-side aggregation involved.