# Authorization error

**URL:** <https://forum.mapillary.com/t/authorization-error/7845>\
**Category:** Imagery, data, and integrations\
**Created:** [March 1, 2024, 2:53pm UTC](https://forum.mapillary.com/t/authorization-error/7845 "2024-03-01T14:53:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrone411](https://avatars.discourse-cdn.com/v4/letter/p/c2a13f/32.png) [@patrone411](https://forum.mapillary.com/u/patrone411)\
**Post date:** [March 1, 2024, 2:53pm UTC](https://forum.mapillary.com/t/authorization-error/7845/1 "2024-03-01T14:53:55Z")

</div>

dear mapillary community,  
i currently face an error while trying to fetch image data from a bounding box request that i am not able to resolve. i tried to follow the code provided in

> **[How to get data from the Mapillary API v4 using Python](https://stuyts.xyz/2021/10/15/how-to-get-data-from-the-mapillary-api-v4-using-python/)**
>
> A while ago I wrote a script to get data from the Mapillary API v3 and that was pretty easy to do so. But in the mean time v3 of their API was discontinued, so I had to rewrite my script to use v4 of the API, but it took me a while to figure out how...

which is:

import requests  
metadata\_endpoint = “[https://graph.mapillary.com](https://graph.mapillary.com)”  
x\_dist = 0.00025  
y\_dist = 0.00025  
testpoint=[51.1543669,4.4436676]  
client\_token = ‘MLY|7096961157099603|7fb2ed4b52bc77827ab9451bf2ec3d8c’  
headers= { “Authorization” : “OAuth {}”.format(client\_token) }  
url\_imagesearch = metadata\_endpoint+‘/images?fields=id&bbox= {},{},{},{}’.format(testpoint[1]-x\_dist, testpoint[0]-y\_dist, testpoint[1]+x\_dist, testpoint[0]+y\_dist)  
response\_imagesearch = requests.get(url\_imagesearch, headers=headers)  
data\_imagesearch = response\_imagesearch.json()  
print(“Images found:” + str(len(data\_imagesearch[‘data’])))  
for image in data\_imagesearch[‘data’]:  
url\_image = metadata\_endpoint+‘/{}?fields=id,thumb\_2048\_url,captured\_at,sequence’.format(image[‘id’])  
response\_image = requests.get(url\_image, headers=headers)  
data\_image = response\_image.json()  
print(data\_image)

but while i got it to work a few days ago, the same exact code will not return image information anymore.  
i created several new client tokens and replaced the one in the given code, but i keep getting this error

{‘error’: {‘code’: -2, ‘error\_subcode’: 3404014, ‘error\_user\_msg’: ‘The query timed out,… the query’, ‘error\_user\_title’: ‘Query Timeout’, ‘fbtrace\_id’: ‘AefW\_vEWIdbz3c9Zs9NZ\_Ux’, ‘is\_transient’: False, ‘message’: ‘Timeout’, ‘type’: ‘OAuthException’}}

and i have no idea how to fix the error.  
i would be very happy for any hint that could help me solve this problem  
regards,

patrick

---

<div class="post-metadata">

**Author:** ![tao](https://avatars.discourse-cdn.com/v4/letter/t/f9ae1b/32.png) [@tao](https://forum.mapillary.com/u/tao)\
**Post date:** [March 4, 2024, 8:54pm UTC](https://forum.mapillary.com/t/authorization-error/7845/2 "2024-03-04T20:54:56Z")

</div>

Hey @patrone411 the API should be back. Please try again.

Sorry for the inconvenience. It was because `The query timed out,… the query` – the high latency of the API bbox queries.
