0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ちょっと変わった “API” を5つ紹介してみる

0
Posted at

はじめに

こんにちは!
今回は、ネタにも学習にもなる “遊べるAPI” を5つ紹介します。

1. What The Commit — カオスなコミットメッセージAPI

開発中に疲れたときに見たくなるカオスなAPI。

URL:
https://whatthecommit.com/index.txt

アクセスするだけで毎回ランダムなコミットメッセージが返ってきます。

例:
Remove entire program because I broke something
I shouldn’t have written all that code

2. Cat Facts — 猫の豆知識API

猫好き向けの癒しAPI。

URL:
https://catfact.ninja/fact

返ってくる例:
{“fact”: “Cats have over 20 muscles that control their ears.”, “length”: 54}

アプリに「今日の猫豆知識」機能をつけられます。

3. ISS Now — 国際宇宙ステーションの現在地API

宇宙のロマンを感じたい人向け。

URL:
http://api.open-notify.org/iss-now.json

返ってくる例:
{“message”:“success”,“iss_position”:{“latitude”:“23.1954”,“longitude”:“45.2539”}}

リアルタイムで地球を周回してる位置が分かる。

4. Punk API — クラフトビール情報API

ビール好きには刺さる API。

URL:
https://api.punkapi.com/v2/beers

返ってくる例:
{“id”:1,“name”:“Buzz”,“tagline”:“A Real Bitter Experience.”,“abv”:4.5}

ビールデータが大量にあるので、ランキングやおすすめアプリも作れる。

5. Excuser API — 言い訳ジェネレーターAPI

最も使ってはいけないけど一番面白い API。

URL(ビジネスカテゴリ):
https://excuser.herokuapp.com/v1/excuse/business

返ってくる例:
[{“category”:“business”,“excuse”:“I didn’t finish the report because my computer crashed.”}]

カテゴリも business / family / office / college など多数。

まとめ

今回紹介したAPIは、
「実務で使う」より「遊んで学べる」タイプのAPIですが、触っていると

・JSONの構造
・APIレスポンスの違い
・外部データ処理の流れ

などが自然と身につくので、実は勉強にもなります。

他にも面白いAPIを知っている人はコメントで教えてください!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?