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?

More than 3 years have passed since last update.

Google Cloud PlatformからAPIキー発行

Last updated at Posted at 2020-11-25

YouTube API

YouTubeに上がっている動画情報をAPIで取得し, 自分のwebページに展開したい.

目次

  1. Googleアカウントがある
  2. Google Cloud Platform(GCP)にアクセス
  3. API key発行
  4. axiosでAPI取得

GCPでAPI keyの発行

ダッシュボードに行きAPIとサービスに入る.

screen_GCP_dashboard.jpg

上部の認証情報作成を押す.

screen_GCP_authinfo.jpg

APIキーが作成されるのでどこかにメモっておく.

当たり前だが, こういったAPIキーは不正に利用されることがあるので取り扱い注意.
screen_GCP_api_key.JPG

API制限

APIはフロントエンドで使われるため, キーに制限を設けて不正利用を防ぐ.
ここでは, HTTPリファラーとして*.hogehoge.com/を指定している.
ローカル環境でも許可したい場合は任意で適当に追記する.
screen_GCP_api_key_restriction.JPG

以上

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?