国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

首頁 web前端 js教程 4 中您需要了解的免費 API

4 中您需要了解的免費 API

Jan 12, 2025 am 10:41 AM

Free APIs You Need to Know About in 4

API(應用程式介面)是開發(fā)人員必不可少的工具,允許他們將第三方服務整合到他們的應用程式中。以下是 2024 年各個類別中可用的免費 API 的詳細列表,以及每個 API 的網站連結、描述和範例程式碼。

遊戲 API

Steam 社群 API

  • 網址:steamcommunity.com/dev

  • 描述:Steamworks Web API 提供了各種 Steam 功能的接口,例如用戶身份驗證、庫存管理和遊戲資料。

範例程式碼

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));

防暴遊戲 API

  • 網站:developer.riotgames.com

  • 描述:存取《英雄聯(lián)盟》、《雲頂之弈》、《Valorant》等遊戲的資料。提供比賽、排名、冠軍以及其他遊戲相關統(tǒng)計數(shù)據(jù)。

範例程式碼

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));

語言API

邪惡侮辱生成器 API

  • 網址:evilinsult.com/api

  • 描述:以各種語言產生隨機侮辱,用於娛樂或測試目的。

範例程式碼

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));

趣味翻譯 API

  • 網址:funtranslations.com/api

  • 描述:將文字翻譯成各種有趣的語言,如尤達、莎士比亞、小黃人語等。

範例程式碼

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));

音樂 API

Spotify 網路 API

  • 網站:developer.spotify.com/documentation/web-api

  • 描述:存取音樂數(shù)據(jù),例如專輯、藝人、播放清單和使用者數(shù)據(jù)??刂?Spotify 播放等。

範例程式碼

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));

安全API

我被偷了嗎 API

  • 網址:haveibeenpwned.com/API/v2

  • 描述:檢查您的電子郵件或使用者名稱是否屬於資料外洩的一部分。提供有關違規(guī)、貼上和密碼洩露的資料。

範例程式碼

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));

首丹API

  • 網址:developer.shodan.io

  • 描述:Shodan 是一個用於網路連線裝置的搜尋引擎。它提供全球各種伺服器、設備和系統(tǒng)的數(shù)據(jù)。

範例程式碼

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));

科學與數(shù)學 API

美國宇航局應用程式編程接口

  • 網址:api.nasa.gov

  • 描述:存取 NASA 資料集中的數(shù)據(jù),包括天文照片、行星資料等。

範例程式碼

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));

Wolfram Alpha API

  • 網址:products.wolframalpha.com/api

  • 描述:提供對 Wolfram Alpha 的大量計算知識的訪問,包括數(shù)學計算、數(shù)據(jù)分析等。

範例程式碼

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));

開放科學框架 API

  • 網站:developer.osf.io

  • 描述:從開放科學框架存取研究資料、專案管理工具和其他科學資源。

範例程式碼

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));

體育 API

NBA應用程式介面

  • 網站:any-api.com/nba_com/nba_com/docs/API_Description

  • 描述:存取 NBA 球隊、球員和比賽的數(shù)據(jù)。

範例程式碼

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));

網路應用 API

不和諧 API

  • 網址:discord.com/developers/docs/intro

  • 描述:將您的應用程式與 Discord 集成,允許用戶身份驗證、訊息傳遞等。

範例程式碼

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));

鬆弛API

  • 網址:api.slack.com

  • 描述:存取 Slack 功能,例如訊息傳遞、使用者資料和工作區(qū)管理。

範例程式碼

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));

產品和事物 API

汽車查詢API

  • 網址:carqueryapi.com

  • 描述:存取汽車數(shù)據(jù),包括

品牌、型號和年份資訊。

範例程式碼

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));

叫喊 API

  • 網址:yelp.com/developers

  • 描述:存取本地商家的數(shù)據(jù),包括評論、評級和商家詳細資訊。

範例程式碼

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));

健康API

醫(yī)療保健.gov API

  • 網址:healthcare.gov/developers

  • 描述:存取醫(yī)療保健計劃、提供者目錄和其他健康相關資訊的資料。

範例程式碼

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));

政府和地理 API

代碼.gov API

  • 網站:code.gov

  • 描述:存取聯(lián)邦政府軟體專案的數(shù)據(jù),包括程式碼儲存庫和專案詳細資訊。

範例程式碼

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));

資料政府API

  • 網址:data.gov/developers/apis

  • 描述:存取來自美國政府的各種資料集,包括天氣、教育和健康資料。

範例程式碼

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));

資料.europa.eu API

  • 網址:data.europa.eu/en

  • 描述:訪問歐盟機構和團體的開放資料。

範例程式碼

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));

傳輸定位API

  • 網址:rapidapi.com/transloc/api/openapi-1-2/details

  • 描述:存取即時公共交通數(shù)據(jù),包括到達預測、車輛位置等。

範例程式碼

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));

食品原料藥

開放食品事實 API

  • 網址:world.openfoodfacts.org/data

  • 描述:存取全球食品數(shù)據(jù),包括成分、營養(yǎng)成分和過敏原資訊。

範例程式碼

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));

塔克花式 API

  • 網址:github.com/evz/tacofancy-api

  • 描述:存取玉米捲食譜數(shù)據(jù),包括成分和製備方法。

範例程式碼

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));

開源專案 API

圖書館.io API

  • 網址:libraries.io/api

  • 描述:存取開源專案的數(shù)據(jù),包括依賴資訊、版本歷史記錄等。

範例程式碼

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));

電影和漫畫 API

查克諾里斯笑話 API

  • 網址:api.chucknorris.io

  • 描述:造訪查克·諾里斯笑話集。

範例程式碼

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));

最終空間 API

  • 網址:finalspaceapi.com

  • 描述:存取《最終太空》電視節(jié)目的數(shù)據(jù),包括角色、劇集等。

範例程式碼

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));

木津API

  • 網址:kitsu.docs.apiary.io

  • 描述:存取動畫和漫畫的數(shù)據(jù),包括系列資訊、評論和用戶評分。

範例程式碼

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));

漫威API

  • 網站:developer.marvel.com

  • 描述:存取有關 Marvel 漫畫、角色和創(chuàng)作者的資料。

範例程式碼

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));

戳API

  • 網址:pokeapi.co

  • 描述:存取神奇寶貝的數(shù)據(jù),包括物種、能力和遊戲資訊。

範例程式碼

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));

瑞克和莫蒂 API

  • 網址:rickandmortyapi.com

  • 描述:存取瑞克和莫蒂電視節(jié)目的數(shù)據(jù),包括角色、劇集和地點。

範例程式碼

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));

辛普森一家行情 API

  • 網址:thesimpsonsquoteapi.glitch.me

  • 說明:造訪《辛普森家庭》電視節(jié)目中的臺詞集。

樣本

代碼

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));

星際大戰(zhàn) API

  • 網址:swapi.tech

  • 描述:存取星際大戰(zhàn)宇宙的數(shù)據(jù),包括電影、角色、星際飛船和行星。

範例程式碼

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));

超級英雄API

  • 網址:superheroapi.com

  • 描述:存取各種超級英雄的數(shù)據(jù),包括他們的力量、傳記和圖像。

範例程式碼

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));

結論

這份 2024 年免費 API 的完整清單涵蓋了廣泛的類別,為開發(fā)人員提供了大量機會,透過強大且多樣化的功能來增強其應用程式。從遊戲和音樂到科學和政府數(shù)據(jù),這些 API 為創(chuàng)建創(chuàng)新且引人入勝的專案提供了寶貴的資源。

隨意探索這些 API 並將它們整合到您的專案中以解鎖新的可能性和功能??鞓肪幋a!


? 與我們保持聯(lián)繫!

我們正在建立一個創(chuàng)新蓬勃發(fā)展、技術愛好者共同成長的社群。與我們一起踏上啟發(fā)、學習和創(chuàng)造的旅程!

?探索更多:

  • Discord:與科技愛好者聯(lián)繫
  • WhatsApp:取得即時更新
  • 電報:每日見解與提示

?追蹤我們,獲得每日靈感:

  • Instagram:@thecampuscoders
  • LinkedIn: @thecampuscoders
  • Facebook: @thecampuscoders

隨時拜訪我們!

? thecampuscoders.com

?探索資源、教程和更新,為您的技術之旅提供動力!


? 讓我們一起合作、學習、共創(chuàng)未來!

有想法或建議嗎?聯(lián)絡我們,成為非凡事業(yè)的一部分!

?聯(lián)絡我們: deepak@thecampuscoders.com

以上是4 中您需要了解的免費 API的詳細內容。更多資訊請關注PHP中文網其他相關文章!

本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發(fā)現(xiàn)涉嫌抄襲或侵權的內容,請聯(lián)絡admin@php.cn

熱AI工具

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創(chuàng)建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發(fā)環(huán)境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發(fā)工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

Java vs. JavaScript:清除混亂 Java vs. JavaScript:清除混亂 Jun 20, 2025 am 12:27 AM

Java和JavaScript是不同的編程語言,各自適用於不同的應用場景。 Java用於大型企業(yè)和移動應用開發(fā),而JavaScript主要用於網頁開發(fā)。

JavaScript評論:簡短說明 JavaScript評論:簡短說明 Jun 19, 2025 am 12:40 AM

JavascriptconcommentsenceenceEncorenceEnterential gransimenting,reading and guidingCodeeXecution.1)單inecommentsareusedforquickexplanations.2)多l(xiāng)inecommentsexplaincomplexlogicorprovideDocumentation.3)

如何在JS中與日期和時間合作? 如何在JS中與日期和時間合作? Jul 01, 2025 am 01:27 AM

JavaScript中的日期和時間處理需注意以下幾點:1.創(chuàng)建Date對像有多種方式,推薦使用ISO格式字符串以保證兼容性;2.獲取和設置時間信息可用get和set方法,注意月份從0開始;3.手動格式化日期需拼接字符串,也可使用第三方庫;4.處理時區(qū)問題建議使用支持時區(qū)的庫,如Luxon。掌握這些要點能有效避免常見錯誤。

JavaScript與Java:開發(fā)人員的全面比較 JavaScript與Java:開發(fā)人員的全面比較 Jun 20, 2025 am 12:21 AM

JavaScriptIspreferredforredforwebdevelverment,而Javaisbetterforlarge-ScalebackendsystystemsandSandAndRoidApps.1)JavascriptexcelcelsincreatingInteractiveWebexperienceswebexperienceswithitswithitsdynamicnnamicnnamicnnamicnnamicnemicnemicnemicnemicnemicnemicnemicnemicnddommanipulation.2)

為什麼要將標籤放在的底部? 為什麼要將標籤放在的底部? Jul 02, 2025 am 01:22 AM

PlacingtagsatthebottomofablogpostorwebpageservespracticalpurposesforSEO,userexperience,anddesign.1.IthelpswithSEObyallowingsearchenginestoaccesskeyword-relevanttagswithoutclutteringthemaincontent.2.Itimprovesuserexperiencebykeepingthefocusonthearticl

JavaScript:探索用於高效編碼的數(shù)據(jù)類型 JavaScript:探索用於高效編碼的數(shù)據(jù)類型 Jun 20, 2025 am 12:46 AM

javascripthassevenfundaMentalDatatypes:數(shù)字,弦,布爾值,未定義,null,object和symbol.1)numberSeadUble-eaduble-ecisionFormat,forwidevaluerangesbutbecautious.2)

什麼是在DOM中冒泡和捕獲的事件? 什麼是在DOM中冒泡和捕獲的事件? Jul 02, 2025 am 01:19 AM

事件捕獲和冒泡是DOM中事件傳播的兩個階段,捕獲是從頂層向下到目標元素,冒泡是從目標元素向上傳播到頂層。 1.事件捕獲通過addEventListener的useCapture參數(shù)設為true實現(xiàn);2.事件冒泡是默認行為,useCapture設為false或省略;3.可使用event.stopPropagation()阻止事件傳播;4.冒泡支持事件委託,提高動態(tài)內容處理效率;5.捕獲可用於提前攔截事件,如日誌記錄或錯誤處理。了解這兩個階段有助於精確控制JavaScript響應用戶操作的時機和方式。

Java和JavaScript有什麼區(qū)別? Java和JavaScript有什麼區(qū)別? Jun 17, 2025 am 09:17 AM

Java和JavaScript是不同的編程語言。 1.Java是靜態(tài)類型、編譯型語言,適用於企業(yè)應用和大型系統(tǒng)。 2.JavaScript是動態(tài)類型、解釋型語言,主要用於網頁交互和前端開發(fā)。

See all articles