Free APIs for PHP developers
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.
Call a public API in PHP
This example calls the Econdb API, which needs no API key. It's a live endpoint: our health check got JSON back from it on Oct 24, 2026.
<?php
$ch = curl_init("https://www.econdb.com/api/");
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($data);Sending an API key in PHP
Most free tiers need a key. Read it from an environment variable and send it as a header:
<?php
$ch = curl_init("https://api.example.com/v1/items");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("API_KEY")],
]);
print_r(json_decode(curl_exec($ch), true));Best free APIs for PHP in 2026
- 1

Bidledger API
Online · 279 msEvery open public tender in the European Union, rebuilt daily from the official TED data.
- No API key needed
- Fast: 279 ms response
- Callable from the browser (CORS)
- HTTPS
No authHTTPSCORS - 2

Dog Facts API
Online · 342 msRandom dog facts. A free animals API by dukengn.github.io.
- No API key needed
- Fast: 342 ms response
- Callable from the browser (CORS)
- HTTPS
No authHTTPSCORS - 3

Dog Facts API
Online · 356 msRandom facts of Dogs. A free animals API by Dog API by kinduff.
- No API key needed
- Fast: 356 ms response
- Callable from the browser (CORS)
- HTTPS
No authHTTPSCORS - 4

Econdb API
Online · 802 msDownload economic and shipping data using Python.
- No API key needed
- Returns JSON at its URL
- Callable from the browser (CORS)
- HTTPS
No authHTTPSCORS - 5

Icanhazip API
Online · 278 msThe family of icanhaz sites help you get more information about your network connection.
- No API key needed
- Fast: 278 ms response
- Callable from the browser (CORS)
- HTTPS
No authHTTPSCORS - 6
Index Agentica API
Online · 382 msAgent-first directory of skills, MCP servers, tools, protocols and APIs as JSON, markdown, llms.txt.
- No API key needed
- Fast: 382 ms response
- Callable from the browser (CORS)
- HTTPS
No authHTTPSCORS - 7
ipwhois API
Online · 226 msIP geolocation with country, city, coordinates, ISP, timezone and flag data.
- No API key needed
- Fast: 226 ms response
- Callable from the browser (CORS)
- HTTPS
No authHTTPSCORS - 8
Microlink.io API
Online · 378 msExtract structured data from any website.
- No API key needed
- Fast: 378 ms response
- Callable from the browser (CORS)
- HTTPS
No authHTTPSCORS - 9

NASA POWER API
Online · 228 msGlobal solar and weather data for energy and agriculture.
- No API key needed
- Fast: 228 ms response
- Callable from the browser (CORS)
- HTTPS
No authHTTPSCORS - 10
Open VSX API
Online · 270 msSearch and access VS Code extensions from the Open VSX registry.
- No API key needed
- Fast: 270 ms response
- Callable from the browser (CORS)
- HTTPS
No authHTTPSCORS - 11

OpenSanctions API
Online · 343 msData on international sanctions, crime and politically exposed persons.
- No API key needed
- Fast: 343 ms response
- Callable from the browser (CORS)
- HTTPS
No authHTTPSCORS - 12

PayCrunch API
Online · 278 msUS wages for 1,008 occupations and by state, from BLS OEWS May 2025, static JSON, CC BY 4.0.
- No API key needed
- Fast: 278 ms response
- Callable from the browser (CORS)
- HTTPS
No authHTTPSCORS - 13

Presend API
Online · 399 msSecurity and developer utility API -- malware, vulnerability, and domain checks, no signup.
- No API key needed
- Fast: 399 ms response
- Callable from the browser (CORS)
- HTTPS
No authHTTPSCORS - 14
RubyGems API
Online · 360 msRuby gem metadata, versions, dependencies and search.
- No API key needed
- Fast: 360 ms response
- Callable from the browser (CORS)
- HTTPS
No authHTTPSCORS - 15
Statically API
Online · 324 msA free CDN for developers.
- No API key needed
- Fast: 324 ms response
- Callable from the browser (CORS)
- HTTPS
No authHTTPSCORS - 16

BirkinBagStock API
Online · 1011 msIndependent Hermès resale index: inventory, market prices, auction calendar and results.
- No API key needed
- Returns JSON at its URL
- Callable from the browser (CORS)
- HTTPS
No authHTTPSCORS - 17
DefiLlama API
Online · 178 msOpen and transparent DeFi data, TVL, coin prices, volumes, and yields.
- No API key needed
- Fast: 178 ms response
- Callable from the browser (CORS)
- HTTPS
No authHTTPSCORS - 18
DocStruct API
Online · 190 msAI extraction of invoices, receipts, bank statements & contracts into structured JSON/CSV.
- No API key needed
- Fast: 190 ms response
- Callable from the browser (CORS)
- HTTPS
No authHTTPSCORS - 19
GBIF API
Online · 115 msGlobal Biodiversity Information Facility. A free science & math API by gbif.org.
- No API key needed
- Fast: 115 ms response
- Callable from the browser (CORS)
- HTTPS
No authHTTPSCORS - 20

Helium API
Online · 377 msNews with media bias scoring, balanced news synthesis, live market data, AI options pricing.
- No API key needed
- Fast: 377 ms response
- Callable from the browser (CORS)
- HTTPS
No authHTTPSCORS - 21
L2 Calendar API
Online · 1046 msLineage 2 private servers list with names, websites, chronicles, rates and opening dates.
- No API key needed
- Returns JSON at its URL
- Callable from the browser (CORS)
- HTTPS
No authHTTPSCORS - 22

Legal Sandbox Georgia API
Online · 563 msFind verified legal specialists in Georgia from natural-language queries.
- No API key needed
- Returns JSON at its URL
- Callable from the browser (CORS)
- HTTPS
No authHTTPSCORS - 23

Macrostrat API
Online · 694 msGeologic maps, rock columns and stratigraphy data.
- No API key needed
- Returns JSON at its URL
- Callable from the browser (CORS)
- HTTPS
No authHTTPSCORS - 24

Modelfax API
Online · 328 msLLM pricing, context windows and deprecation dates, schema-validated and updated daily.
- No API key needed
- Fast: 328 ms response
- Callable from the browser (CORS)
- HTTPS
No authHTTPSCORS - 25
RemoteOK API
Online · 861 msRemote job board for digital nomads.
- No API key needed
- Returns JSON at its URL
- Callable from the browser (CORS)
- HTTPS
No authHTTPSCORS
Live JSON endpoints to try
These API URLs returned valid JSON in our latest check, so the PHP example above works with any of them.
Econdb APIhttps://www.econdb.com/api/
<?php
$ch = curl_init("https://www.econdb.com/api/");
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($data);BirkinBagStock APIhttps://birkinbagstock.com/.well-known/openapi.json
<?php
$ch = curl_init("https://birkinbagstock.com/.well-known/openapi.json");
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($data);L2 Calendar APIhttps://l2calendar.com/api/servers
<?php
$ch = curl_init("https://l2calendar.com/api/servers");
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($data);Legal Sandbox Georgia APIhttps://legal.ge/api/openapi.json
<?php
$ch = curl_init("https://legal.ge/api/openapi.json");
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($data);Macrostrat APIhttps://macrostrat.org/api
<?php
$ch = curl_init("https://macrostrat.org/api");
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($data);RemoteOK APIhttps://remoteok.com/api
<?php
$ch = curl_init("https://remoteok.com/api");
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($data);Veabird APIhttps://veabird.com/api/v1
<?php
$ch = curl_init("https://veabird.com/api/v1");
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($data);Verif Entreprise FR APIhttps://api-production-24833.up.railway.app
<?php
$ch = curl_init("https://api-production-24833.up.railway.app");
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($data);AI Economics Tools APIhttps://piszczek.pl/tools/api
<?php
$ch = curl_init("https://piszczek.pl/tools/api");
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($data);BlazePhoenix APIhttps://blazephoenix.xyz/api
<?php
$ch = curl_init("https://blazephoenix.xyz/api");
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($data);Block Lottos APIhttps://blocklottos.com/openapi.json
<?php
$ch = curl_init("https://blocklottos.com/openapi.json");
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($data);ConnectMeGuru APIhttps://www.connectmeguru.com/api/mcp
<?php
$ch = curl_init("https://www.connectmeguru.com/api/mcp");
curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 10]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($data);PHP API FAQ
How do I call a REST API in PHP?
Send an HTTP GET request to the API's URL, check the status code, and parse the JSON body. The working example on this page does exactly that against a live, keyless public API.
Where do I put an API key in PHP?
Read it from an environment variable and send it in a header (usually Authorization: Bearer …), never hard-coded or committed to git.
Which free APIs work best with PHP?
This page ranks 25 free APIs that suit PHP, ordered by ease of access, uptime and developer ratings.