DEV Community

Cover image for Free APIs You Need to Know About in 2024
RaAj Aryan
RaAj Aryan

Posted on • Updated on • Originally published at raajaryan.tech

Free APIs You Need to Know About in 2024

BuyMeACoffee

APIs (Application Programming Interfaces) are essential tools for developers, allowing them to integrate third-party services into their applications. Here is an extensive list of free APIs available in 2024 across various categories, along with website links, descriptions, and sample code for each.

Gaming APIs

Steam Community API

  • Website: steamcommunity.com/dev
  • Description: The Steamworks Web API provides an interface to various Steam features such as user authentication, inventory management, and game data.

Sample Code

const fetch = require('node-fetch');

const steamApiKey = 'YOUR_STEAM_API_KEY';
const steamId = 'STEAM_USER_ID';
const url = `http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=${steamApiKey}&steamids=${steamId}`;

fetch(url)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Riot Games API

  • Website: developer.riotgames.com
  • Description: Access data for games like League of Legends, Teamfight Tactics, Valorant, and more. Provides data on matches, rankings, champions, and other game-related statistics.

Sample Code

const fetch = require('node-fetch');

const riotApiKey = 'YOUR_RIOT_API_KEY';
const summonerName = 'SUMMONER_NAME';
const url = `https://na1.api.riotgames.com/lol/summoner/v4/summoners/by-name/${summonerName}?api_key=${riotApiKey}`;

fetch(url)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Language APIs

Evil Insult Generator API

  • Website: evilinsult.com/api
  • Description: Generate random insults in various languages for fun or testing purposes.

Sample Code

const fetch = require('node-fetch');

const url = 'https://evilinsult.com/generate_insult.php?lang=en&type=json';

fetch(url)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Fun Translations API

  • Website: funtranslations.com/api
  • Description: Translate text into various fun languages like Yoda, Shakespeare, Minion speak, and more.

Sample Code

const fetch = require('node-fetch');

const text = 'Hello, world!';
const url = `https://api.funtranslations.com/translate/yoda.json?text=${encodeURIComponent(text)}`;

fetch(url)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Music APIs

Spotify Web API

Sample Code

const fetch = require('node-fetch');

const accessToken = 'YOUR_SPOTIFY_ACCESS_TOKEN';
const url = 'https://api.spotify.com/v1/me/player/recently-played';

fetch(url, {
    headers: {
        'Authorization': `Bearer ${accessToken}`
    }
})
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Security APIs

Have I Been Pwned API

  • Website: haveibeenpwned.com/API/v2
  • Description: Check if your email or username has been part of a data breach. Provides data on breaches, pastes, and password exposure.

Sample Code

const fetch = require('node-fetch');

const email = 'test@example.com';
const url = `https://haveibeenpwned.com/api/v2/breachedaccount/${email}`;

fetch(url, {
    headers: {
        'User-Agent': 'Node.js'
    }
})
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Shodan API

  • Website: developer.shodan.io
  • Description: Shodan is a search engine for Internet-connected devices. It provides data on various servers, devices, and systems worldwide.

Sample Code

const fetch = require('node-fetch');

const shodanApiKey = 'YOUR_SHODAN_API_KEY';
const query = 'apache';
const url = `https://api.shodan.io/shodan/host/search?key=${shodanApiKey}&query=${query}`;

fetch(url)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Science & Math APIs

NASA API

  • Website: api.nasa.gov
  • Description: Access data from NASA’s datasets including astronomy photos, planetary data, and more.

Sample Code

const fetch = require('node-fetch');

const nasaApiKey = 'YOUR_NASA_API_KEY';
const url = `https://api.nasa.gov/planetary/apod?api_key=${nasaApiKey}`;

fetch(url)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Wolfram Alpha API

  • Website: products.wolframalpha.com/api
  • Description: Provides access to the vast computational knowledge of Wolfram Alpha, including math calculations, data analysis, and more.

Sample Code

const fetch = require('node-fetch');

const wolframAppId = 'YOUR_WOLFRAM_APP_ID';
const query = 'integrate x^2';
const url = `http://api.wolframalpha.com/v2/query?input=${encodeURIComponent(query)}&appid=${wolframAppId}&output=json`;

fetch(url)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Open Science Framework API

  • Website: developer.osf.io
  • Description: Access research data, project management tools, and other scientific resources from the Open Science Framework.

Sample Code

const fetch = require('node-fetch');

const url = 'https://api.osf.io/v2/nodes/';

fetch(url)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Sports APIs

NBA API

Sample Code

const fetch = require('node-fetch');

const url = 'https://api-nba-v1.p.rapidapi.com/teams/league/standard';
const options = {
    method: 'GET',
    headers: {
        'X-RapidAPI-Key': 'YOUR_RAPIDAPI_KEY',
        'X-RapidAPI-Host': 'api-nba-v1.p.rapidapi.com'
    }
};

fetch(url, options)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Web Apps APIs

Discord API

Sample Code

const fetch = require('node-fetch');

const discordToken = 'YOUR_DISCORD_BOT_TOKEN';
const url = 'https://discord.com/api/users/@me';

fetch(url, {
    headers: {
        'Authorization': `Bot ${discordToken}`
    }
})
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Slack API

  • Website: api.slack.com
  • Description: Access Slack features such as messaging, user data, and workspace management.

Sample Code

const fetch = require('node-fetch');

const slackToken = 'YOUR_SLACK_API_TOKEN';
const url = 'https://slack.com/api/conversations.list';

fetch(url, {
    headers: {
        'Authorization': `Bearer ${slackToken}`
    }
})
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Products and Things APIs

Car Query API

make, model, and year information.

Sample Code

const fetch = require('node-fetch');

const url = 'https://www.carqueryapi.com/api/0.3/?cmd=getMakes';

fetch(url)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Yelp API

  • Website: yelp.com/developers
  • Description: Access data on local businesses, including reviews, ratings, and business details.

Sample Code

const fetch = require('node-fetch');

const yelpApiKey = 'YOUR_YELP_API_KEY';
const url = 'https://api.yelp.com/v3/businesses/search?location=San Francisco';

fetch(url, {
    headers: {
        'Authorization': `Bearer ${yelpApiKey}`
    }
})
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Health APIs

Healthcare.gov API

  • Website: healthcare.gov/developers
  • Description: Access data on healthcare plans, provider directories, and other health-related information.

Sample Code

const fetch = require('node-fetch');

const url = 'https://data.healthcare.gov/resource/xyz123.json';

fetch(url)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Governments & Geography APIs

Code.gov API

  • Website: code.gov
  • Description: Access data on federal government software projects, including code repositories and project details.

Sample Code

const fetch = require('node-fetch');

const url = 'https://api.code.gov/projects';

fetch(url)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Data.gov API

  • Website: data.gov/developers/apis
  • Description: Access a wide range of datasets from the US government, including weather, education, and health data.

Sample Code

const fetch = require('node-fetch');

const url = 'https://api.data.gov/ed/collegescorecard/v1/schools.json?api_key=YOUR_DATA_GOV_API_KEY';

fetch(url)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Data.europa.eu API

  • Website: data.europa.eu/en
  • Description: Access open data from European Union institutions and bodies.

Sample Code

const fetch = require('node-fetch');

const url = 'https://data.europa.eu/api/hub/search/datasets';

fetch(url)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

TransLoc API

Sample Code

const fetch = require('node-fetch');

const translocApiKey = 'YOUR_TRANSLOC_API_KEY';
const url = 'https://transloc-api-1-2.p.rapidapi.com/agencies.json';

fetch(url, {
    headers: {
        'X-RapidAPI-Key': translocApiKey,
        'X-RapidAPI-Host': 'transloc-api-1-2.p.rapidapi.com'
    }
})
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Food APIs

Open Food Facts API

  • Website: world.openfoodfacts.org/data
  • Description: Access data on food products worldwide, including ingredients, nutrition facts, and allergen information.

Sample Code

const fetch = require('node-fetch');

const url = 'https://world.openfoodfacts.org/api/v0/product/737628064502.json';

fetch(url)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Taco Fancy API

Sample Code

const fetch = require('node-fetch');

const url = 'http://taco-randomizer.herokuapp.com/random/';

fetch(url)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Open Source Projects APIs

Libraries.io API

  • Website: libraries.io/api
  • Description: Access data on open source projects, including dependency information, version history, and more.

Sample Code

const fetch = require('node-fetch');

const librariesApiKey = 'YOUR_LIBRARIES_IO_API_KEY';
const url = `https://libraries.io/api/platforms?api_key=${librariesApiKey}`;

fetch(url)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Movies and Comics APIs

Chuck Norris Jokes API

Sample Code

const fetch = require('node-fetch');

const url = 'https://api.chucknorris.io/jokes/random';

fetch(url)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Final Space API

  • Website: finalspaceapi.com
  • Description: Access data from the Final Space TV show, including characters, episodes, and more.

Sample Code

const fetch = require('node-fetch');

const url = 'https://finalspaceapi.com/api/v0/character';

fetch(url)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Kitsu API

  • Website: kitsu.docs.apiary.io
  • Description: Access data on anime and manga, including series information, reviews, and user ratings.

Sample Code

const fetch = require('node-fetch');

const url = 'https://kitsu.io/api/edge/anime';

fetch(url)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Marvel API

  • Website: developer.marvel.com
  • Description: Access data on Marvel comics, characters, and creators.

Sample Code

const fetch = require('node-fetch');

const marvelPublicKey = 'YOUR_MARVEL_PUBLIC_KEY';
const marvelPrivateKey = 'YOUR_MARVEL_PRIVATE_KEY';
const ts = new Date().getTime();
const hash = require('crypto').createHash('md5').update(ts + marvelPrivateKey + marvelPublicKey).digest('hex');
const url = `https://gateway.marvel.com/v1/public/characters?ts=${ts}&apikey=${marvelPublicKey}&hash=${hash}`;

fetch(url)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

PokeAPI

  • Website: pokeapi.co
  • Description: Access data on Pokémon, including species, abilities, and game information.

Sample Code

const fetch = require('node-fetch');

const url = 'https://pokeapi.co/api/v2/pokemon/ditto';

fetch(url)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Rick and Morty API

  • Website: rickandmortyapi.com
  • Description: Access data on the Rick and Morty TV show, including characters, episodes, and locations.

Sample Code

const fetch = require('node-fetch');

const url = 'https://rickandmortyapi.com/api/character';

fetch(url)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Simpsons Quotes API

Sample

Code

const fetch = require('node-fetch');

const url = 'https://thesimpsonsquoteapi.glitch.me/quotes';

fetch(url)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Star Wars API

  • Website: swapi.tech
  • Description: Access data on the Star Wars universe, including films, characters, starships, and planets.

Sample Code

const fetch = require('node-fetch');

const url = 'https://swapi.tech/api/people/1';

fetch(url)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Superhero API

  • Website: superheroapi.com
  • Description: Access data on various superheroes, including their powers, biographies, and images.

Sample Code

const fetch = require('node-fetch');

const superheroApiKey = 'YOUR_SUPERHERO_API_KEY';
const url = `https://superheroapi.com/api/${superheroApiKey}/1`;

fetch(url)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
Enter fullscreen mode Exit fullscreen mode

Conclusion

This comprehensive list of free APIs for 2024 spans a wide range of categories, offering developers numerous opportunities to enhance their applications with powerful and diverse functionalities. From gaming and music to science and government data, these APIs provide valuable resources for creating innovative and engaging projects.

Feel free to explore these APIs and integrate them into your projects to unlock new possibilities and features. Happy coding!


💰 You can help me by Donating

BuyMeACoffee

Top comments (84)

Collapse
 
hosseinyazdi profile image
Hossein Yazdi

Useful list. I'd also like to add this website (API Tracker), which has the world's biggest API search engine.

Collapse
 
ccoveille profile image
Christophe Colombier • Edited

This site is not open-source, right?

Not a real problem, but I would like to know if I could find the GitHub to watch modifications

I knew the following one, but not
API Tracker

GitHub logo public-apis / public-apis

A collective list of free APIs

Try Public APIs for free

Explore popular APIs and see them work in Postman

APILayer Logo

APILayer is the fastest way to integrate APIs into any product. They created this repository to support the community in easily finding public APIs. Explore their collections on the Postman API Network.

APILayer APIs

API Description Call this API
IP Stack Locate and Identify Website Visitors by IP Address Run In Postman
Marketstack Free, easy-to-use REST API interface delivering worldwide stock market data in JSON format Run In Postman
Weatherstack Retrieve instant, accurate weather information for any location in the world in lightweight JSON format Run In Postman
Numverify Global Phone Number Validation & Lookup JSON API Run In Postman
Fixer Fixer is a simple and lightweight API for current and historical foreign exchange (forex) rates. Run In Postman

Popular APIs

API Description Auth Call this API
HTTP Cat Cat for every HTTP Status No Run In Postman
Sportmonks Football Football score/schedule, news API, tv channels, stats, history, display standing e.g. epl, la
Collapse
 
hosseinyazdi profile image
Hossein Yazdi

Nope. though they have a GitHub page, I didn't find any page for their site, specifically.

Collapse
 
raajaryan profile image
RaAj Aryan

Thanks for the suggestion

Collapse
 
ujjwal_dhakal_1a4b989f2a2 profile image
Ujjwal Dhakal • Edited

.

Thread Thread
 
raajaryan profile image
RaAj Aryan

??

Collapse
 
sethsandaru profile image
Seth Phat

If you want to render HTML to PDF with modern CSS, feel free to use RenderPDF.io 😉

Collapse
 
raajaryan profile image
Deepak Kumar

sure

Collapse
 
benjick profile image
Max Malm

Why is everyone posting about how useful this list it? Bots? It's tbh not that useful

Collapse
 
tacodes profile image
tacodes

Max! What APIs do you consider more useful? It would be great to add some value to your criticism so that their next article will satisfy you

Collapse
 
benjick profile image
Max Malm • Edited

Useful for what?

Thanks for replying

Thread Thread
 
tacodes profile image
tacodes

"to be honest it's not that useful"

So, what's useful to you? Please share! Add some value with your words!

Thread Thread
 
benjick profile image
Max Malm

I didn't make this post, do you think it's useful? If so, what do you think it's useful for?

Collapse
 
atsag profile image
Andreas

Deepak, thank you for the API compilation. I am sad though, that you included the insults api. As educated people, I doubt nurturing lower insticts and behaviours promoting harshness and violence 'for fun' or 'testing' helps anyone be happy.

Collapse
 
dk119819 profile image
Deepak Kumar

Thank you for your feedback. I appreciate your concerns regarding the inclusion of the insults API. You're absolutely right that promoting positive and respectful behavior is important, especially in a professional context. I'll make sure to be more mindful of this in the future. If there's anything specific you would like to see or avoid in my future compilations, please let me know.

Collapse
 
ezilemdodana profile image
Ezile Mdodana

Great stuff!. Thank you very much for sharing.

Collapse
 
dk119819 profile image
Deepak Kumar

Thank you! I'm glad you found the list helpful.

Collapse
 
manchicken profile image
Mike Stemle

Many of the snippets in this article include credentials in the URL parameters, which is a serious security issue. I urge my fellow readers to not use snippets which have credentials in the URL.

Collapse
 
litlyx profile image
Antonio | CEO at Litlyx.com

Highlighting these free APIs for 2024 is incredibly helpful for developers looking to expand their projects without breaking the bank. Thanks for sharing such a valuable resource!

Collapse
 
dk119819 profile image
Deepak Kumar

Thank you! I'm glad you found the list helpful.

Collapse
 
atrandafir profile image
Alexandru Trandafir

Did anybody implement Enterprise.com Car Rental API or Xml integration? I can't seem to find any public documentation for developers and my client did not receive yet any technical info from them.

Collapse
 
dk119819 profile image
Deepak Kumar

I will inform you shortly 😊

Collapse
 
caominhdev profile image
Cao Quốc Minh

Thanks you!

Collapse
 
dk119819 profile image
Deepak Kumar

Thank you! I'm glad you found it helpful.

Also, please check out my recent work on GitHub: ULTIMATE JAVASCRIPT PROJECT. If you find it useful, don't forget to star the repository!

Collapse
 
kemiowoyele1 profile image
Kemi Owoyele

thank you very much for this article

Collapse
 
dk119819 profile image
Deepak Kumar

Thank you! I'm glad you found the list helpful.

Collapse
 
geauxweisbeck4 profile image
Andrew Weisbeck

Very cool, helpful, and creative!

Collapse
 
dk119819 profile image
Deepak Kumar

Thank you! I'm glad you found the list helpful.

Collapse
 
georgebullock profile image
George Bullock

Nice list. Thanks for sharing.

Collapse
 
dk119819 profile image
Deepak Kumar

Thank you! I'm glad you found the list helpful.

Collapse
 
smith1kang profile image
QKhang

:like

Collapse
 
dk119819 profile image
Deepak Kumar

Thank you! I'm glad you found the list helpful.

Collapse
 
ccoveille profile image
Christophe Colombier

A second post about that in a few days, great

The first one was made by @falselight here

Collapse
 
thuancoffee profile image
Thuan Tran

so great! love it

Collapse
 
dk119819 profile image
Deepak Kumar

Thank you! I'm glad you found the list helpful.

Some comments may only be visible to logged-in visitors. Sign in to view all comments.