Guide to 12 APIs: How to Use, Get Tokens, and Applications
1. JSONPlaceholder
How to Use: No authentication needed.
Example:
fetch('[Link] =>
[Link]()).then(data => [Link](data));
Uses: Prototyping, testing REST API calls.
Documentation: [Link]
2. Dog CEO's Dog API
How to Use: No authentication needed.
Example:
fetch('[Link] =>
[Link]()).then(data => [Link]([Link]));
Uses: Displaying random dog images.
Documentation: [Link]
3. Bored API
How to Use: No authentication needed.
Example:
fetch('[Link] =>
[Link]()).then(data => [Link](data));
Uses: Suggesting random activities for users.
Documentation: [Link]
4. TheMealDB API
How to Use: Requires an API key (register on their website).
Example:
fetch('[Link]
ata').then(response => [Link]()).then(data =>
[Link](data));
Uses: Recipe apps, meal suggestions.
Documentation: [Link]
5. OpenWeatherMap API
How to Get Token: Sign up at [Link] and
generate an API key.
Example:
const apiKey =
'YOUR_API_KEY';fetch(`[Link]
her?q=London&appid=${apiKey}`).then(response =>
[Link]()).then(data => [Link](data));
Uses: Weather forecasts, real-time weather apps.
Documentation: [Link]
6. GitHub API
How to Get Token: Log in to GitHub and go to Settings > Developer
settings > Personal access tokens to generate a token.
Example:
const token =
'YOUR_PERSONAL_ACCESS_TOKEN';fetch('[Link]
sers/username', { headers: { Authorization: `Bearer ${token}` }
}).then(response => [Link]()).then(data => [Link](data));
Uses: Show GitHub profiles, repositories.
Documentation: [Link]
7. The Movie Database (TMDb) API
How to Get Token: Create an account on [Link]
and generate an API key in Account > Settings > API.
Example:
const apiKey =
'YOUR_API_KEY';fetch(`[Link]
pi_key=${apiKey}`).then(response => [Link]()).then(data =>
[Link]([Link]));
Uses: Movie recommendations, search functionality.
Documentation: [Link]
8. Unsplash API
How to Get Token: Create an account on
[Link] and register your app to get an API
key.
Example:
const apiKey =
'YOUR_API_KEY';fetch(`[Link]
{apiKey}`).then(response => [Link]()).then(data =>
[Link](data));
Uses: Display image galleries.
Documentation: [Link]
9. YouTube Data API
How to Get Token: Go to [Link] create a
project, enable the YouTube Data API v3, and generate an API key.
Example:
const apiKey =
'YOUR_API_KEY';fetch(`[Link]
ch?part=snippet&q=coding&key=${apiKey}`).then(response =>
[Link]()).then(data => [Link]([Link]));
Uses: Display YouTube videos.
Documentation: [Link]
10. Twitter API
How to Get Token: Apply for a developer account at
[Link] then generate an OAuth token.
Example:
const token =
'YOUR_BEARER_TOKEN';fetch('[Link]
453489038376136711', { headers: { Authorization: `Bearer ${token}` }
}).then(response => [Link]()).then(data => [Link](data));
Uses: Show tweets, trends, and user data.
Documentation: [Link]
11. Spotify Web API
How to Get Token: Register an app on [Link]
and use OAuth 2.0 to generate an access token.
Example:
const token =
'YOUR_ACCESS_TOKEN';fetch('[Link] {
headers: { Authorization: `Bearer ${token}` } }).then(response =>
[Link]()).then(data => [Link](data));
Uses: Music apps, playlist builders.
Documentation:
[Link]
12. Stripe API
How to Get Token: Create a Stripe account at [Link] and
go to Developers > API keys to generate a key.
Example:
const stripe =
require('stripe')('YOUR_SECRET_KEY');[Link]({
email: 'customer@[Link]' }).then([Link]);
Uses: Payment integration, e-commerce apps.
Documentation: [Link]