Guides
Build with API Ninjas
Copy-paste-ready tutorials that show you how to pull real data from our APIs in minutes — code examples, prerequisites, and common variations included.
Finance
Stock prices, sales tax, gold, exchange rates, and other market data.
How to Get Stock Price in Python
Get live stock prices in Python with the Stock Price API: quick start, endpoint reference, a production-ready client with retries, watchlists, and historical OHLCV data.
Read guideHow to Get Exchange Rates in Python
Fetch live currency exchange rates in Python using the API Ninjas Exchange Rate API. Convert between any two currencies with one HTTP call.
Read guideHow to Get Cryptocurrency Prices in Python
Get real-time cryptocurrency prices in Python with the API Ninjas Crypto Price API. Covers BTC, ETH, and any supported trading pair.
Read guideHow to Calculate Sales Tax
The sales tax formula with worked examples, reverse calculation, and code to look up the exact combined rate for any US ZIP code.
Read guideGold Price History
Key milestones in gold price history from 1971 to today, plus code to pull current and historical OHLCV gold prices and chart them.
Read guideData
Weather, geocoding, nutrition, and other reference data.
How to Get Weather Data in Python
Get current weather data in Python with the API Ninjas Weather API. Includes lookup by city, lat/lon, error handling, and unit conversion.
Read guideHow to Get Nutrition Data in Python
Get calories, macronutrients, and serving information for any food in Python using the API Ninjas Nutrition API.
Read guideHow to Convert a City to Latitude and Longitude in Python
Convert city names and US ZIP codes to latitude/longitude coordinates in Python using the API Ninjas Geocoding API.
Read guideHow to Get Public Holidays in Python
Fetch public and bank holidays for any country and year in Python using the API Ninjas Holidays API.
Read guideHow to Get Historical Weather Data
Download past weather from NOAA and Open-Meteo archives with Python, and build your own ongoing observation log with the Weather API.
Read guideUtilities
PDF and OCR pipelines, IP geolocation, QR codes, and developer utilities.
How to Get IP Geolocation in Python
Look up the country, city, and coordinates for any IP address in Python using the API Ninjas IP Lookup API.
Read guideHow to Validate an Email Address in Python
Validate email addresses in Python using the API Ninjas Validate Email API. Checks syntax, deliverability, and disposable email flags.
Read guideHow to Generate QR Codes in Python
Generate QR codes in Python and save them as image files using the API Ninjas QR Code API.
Read guideHow to Convert a PDF to Text
Convert PDF to text in Python with pypdf, on the command line, or with OCR for scanned PDFs via the Image to Text API.
Read guideHow to OCR a PDF
OCR a scanned PDF in Python: render pages to images, recognize text with the Image to Text API, and reassemble it in reading order.
Read guideHow to Convert PDF to CSV
Extract tables from PDFs with pdfplumber and write them to CSV or Excel, plus an OCR pipeline for scanned tables using bounding boxes.
Read guide