Built by Developers for developers
An API is only as good as its documentation - that's why we hired the world's best technical writers to create the most clear and concise API specs.
Sample Request and Response
All our APIs contain example request URLs with parameters and complete sample responses. You can see exactly what data is returned and how to process it.
{
"is_valid": true,
"country": "United States",
"country_code": "US",
"region_code": "IL",
"region": "Illinois",
"city": "Chicago",
"zip": "60620",
"lat": 41.7405,
"lon": -87.6587,
"timezone": "America/Chicago",
"isp": "Comcast Cable Communications, LLC",
"address": "73.9.149.180"
}
import requests
symbol = 'AAPL'
api_url = 'https://api.api-ninjas.com/v1/stockprice?ticker={}'.format(symbol)
response = requests.get(api_url, headers={'X-Api-Key': 'YOUR_API_KEY'})
if response.status_code == requests.codes.ok:
print(response.text)
else:
print("Error:", response.status_code, response.text)
Example Code Snippets
Every API contains example code in 5+ programming languges so you can copy-paste the implementations directly into your projects.
Live Demos
More than 95% of our APIs contain live demos. No API Key required!