Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Receiving a status 429 too many requests when executing code in cloud function but not when executing it locally

$
0
0

I want to automate an api call with cloud functions but it does not work.The code works fine locally but I receive 429 when using cloud functions.Is there a way to handle it in code? or is it a problem with my account?This is the api call:

def get_visits(request):endpoint = "https://api.mercadolibre.com/items/visits?ids=" + str(i) +"&date_from=" + str(yesterday) +"T00:00:00.000-00:00&date_to=" + str(today) +"T00:00:00.000-00:00"payload={}headers = {'Authorization': 'Bearer '+ access_token}response = requests.get(endpoint, headers=headers, data=payload)if response.status_code != 200:        print('API response: ', response.text)else:    return response.json()

Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>