Crime Data By ZipCode API

FREEMIUM
By Zyla Labs | Updated a month ago | Data
Popularity

9.5 / 10

Latency

3,742ms

Service Level

100%

Health Check

N/A

Back to All Discussions

python requests request failed with 503

Rapid account: NTGR 8 R
NTGR8R
9 months ago

Copy of your example and added my key:
import requests

url = “https://crime-data-by-zipcode-api.p.rapidapi.com/crime_data

querystring = {“zip”:“94109”}

headers = {
“X-RapidAPI-Key”: “177ca92fc3msh20a796fb7be565ep1d81d2jsn267ca7f44408”,
“X-RapidAPI-Host”: “crime-data-by-zipcode-api.p.rapidapi.com
}

response = requests.get(url, headers=headers, params=querystring)

Check if the request was successful

if response.status_code == 200:
print(‘Success!’)
else:
# Print an error message
print(f"Request failed with status code: {response.status_code}")

print(response.json())

Join in the discussion - add comment below:

Login / Signup to post new comments