Free APIs by programming language
Pick your language for a working example against a live public API, how to send an API key safely, and the best free APIs to build with.
APIs for Python
Python is the most common language for scripts, data work and back ends that call public APIs. The requests library handles HTTPS, JSON and headers in a few lines.
APIs for JavaScript
JavaScript in the browser can call any public API that allows CORS, straight from your front end with fetch. APIs without CORS need a small server or serverless proxy instead.
APIs for Node.js
Node.js 18+ ships fetch built in, so calling a public API from a server, CLI or serverless function needs no dependencies. CORS doesn't apply on the server, so every API in the directory works.
APIs for PHP
PHP powers a large share of the web, and calling a public API takes only cURL or file_get_contents plus json_decode, with no framework required.
APIs for Java
Java 11+ includes java.net.http.HttpClient, a modern HTTP client for calling public APIs synchronously or asynchronously without extra libraries.
APIs for Go
Go's standard library has everything needed to call a public API: net/http for the request and encoding/json for the response, with timeouts built in.
APIs for Ruby
Ruby's net/http and json libraries ship with the language, so a public API call is a two-line script, and Rails apps can use the same code in a service object.
APIs for C#
C# and .NET call public APIs with HttpClient and System.Text.Json, both built into the framework, from console apps, ASP.NET back ends or Unity games.