Retrieve image from certain address via API

Hi all
I have this python code the retrieve an image of a specific address via API. Can someone help me to find out why i get an empty response? Thank you so much!

import requests

Set up API endpoint and parameters

endpoint = “https://graph.mapillary.com/images
params = {
“access_token”: “Client Secret”,
“query”: “{ "
’ search(n:1, query:”{ADDRESS}") { ’
" edges { "
" node { "
" id "
" thumb_url "
" } "
" } "
" } "
“}”,
}

Replace {ADDRESS} with the address you want to search for

address = “1600 Pennsylvania Ave NW, Washington, DC 20500”
params[“query”] = params[“query”].replace(“{ADDRESS}”, address)

Make a request to the Mapillary API

response = requests.get(endpoint, params=params)

Retrieve the URL of the image

if response.status_code == 200 and len(response.json()[“data”][“search”][“edges”]) > 0:
image_url = response.json()[“data”][“search”][“edges”][0][“node”][“thumb_url”]
print(image_url)
else:
print(“Unable to retrieve image”)

also, this code didn’t work;

import requests

Set up API endpoint and parameters

endpoint = ‘https://a.mapillary.com/v3/images
params = {
‘access_token’: ‘Client secret’,
‘closeto’: ‘LATITUDE,LONGITUDE’,
‘radius’: ‘50’,
‘per_page’: ‘1’,
‘sort_by’: ‘captured_at’,
‘client_timestamp’: ‘YOUR_TIMESTAMP’
}

Convert address to latitude and longitude

You would need to use a geocoding service to do this

latitude = 37.7749
longitude = -122.4194

Update the ‘closeto’ parameter with the latitude and longitude values

params[‘closeto’] = f’{latitude},{longitude}’

Make a request to the Mapillary API

response = requests.get(endpoint, params=params)

Retrieve the URL of the image

if response.status_code == 200 and len(response.json()[‘features’]) > 0:
image_url = response.json()[‘features’][0][‘properties’][‘thumbnail’]
print(image_url)
else:
print(‘Unable to retrieve image’)

can anyone help?