🔑API Key
Also known as API Keys, Secret Key, x-api-key
A long secret string. It tells an API which app or account is calling.
Think of it like
Think of it like a members' card for a club. It shows which member is at the door.
Example
Jack signs up for a weather API and gets a key. His app sends it with each call, and the service counts his 1,000 free calls a day.
Why it matters
It is the easiest way to call a paid API. It is also the easiest secret to leak by mistake.
Definition
Example code
http
GET /v1/forecast?city=Leeds HTTP/1.1
X-API-Key: 3f9a2c71d8e04b6aCommon mistake
Key takeaways
- 1Says who is calling. An app or account.
- 2Used to bill and limit. Quota and rate limits.
- 3Lasts until revoked. So guard it well.