26.08.2026
What Is an API Key?
What is an API key? It is a unique code for requests sent to an API. An API, or application programming interface, lets software share data and features.
The key links each request to an app, project, or account. It helps a service check whether the caller has access. The key also helps track who made each call.
If you search “what is the API key,” you are asking about this access code. The phrase “what is API key mean” has the same goal. In simple terms, it means a code that helps identify software requests.
- It identifies the source of an API request
- It can allow or block access
- It can track use by app or project
- It can support limits and billing rules
An API key is not a full sign-in method. Anyone who steals it may use it until you revoke it. Treat secret keys like passwords.
How API Keys Work
A developer first creates a key in an API provider account. The app then adds that key to each request. Most apps send it in a request header.
Some services accept a key in a query field. This method can expose the key in browser history or server logs. Use the provider's safest method when one is available.
The server reads the key and checks its status. It may check the linked project, allowed service, expiry date, and usage limit.
If the checks pass, the server handles the request. A missing key may cause a 401 error. A key without enough access may cause a 403 error.
API keys can identify a caller, but they do not prove a person's identity. For user access, add OAuth or short-lived tokens. OWASP's API security guidance explains why each request still needs strong access checks.
What Is an API Key Used For?
What is an API key used for? It lets an approved app call a service. A web app may use one for maps, weather data, search, or payments.
What is API key used for in a mobile app? It can connect the app to cloud tools or public data. The provider can link those calls to one project.
IoT devices also use API keys. A sensor may send temperature data each minute. The service can link each reading to one device.
Keys also help teams manage shared services. An owner can set daily call limits for each app. They can review traffic and spot a leaked key.
- Getting weather, map, search, or stock data
- Sending data from connected devices
- Linking mobile apps to cloud tools
- Tracking API use across projects
- Applying rate limits and service quotas

Public and Private API Keys
Public keys support limited access from a browser or app. A map widget may need one in browser code. The provider should limit that key by site, service, and daily use.
Public does not mean safe for every task. A public key should only reach non-sensitive data. It should never grant access to private records or account changes.
Private keys stay on trusted servers. They can control access to sensitive data or paid actions. Never place one in a mobile app, browser bundle, public code store, or shared chat.
| Key type | Best use | Main control |
|---|---|---|
| Public key | Limited browser or app access | Restrict its source and services |
| Private key | Server access to protected data | Keep it in a secure secret store |

API Key Security Best Practices
Good API key security starts with low exposure. Keep private keys in environment settings or a managed secret store. Do not hard-code them in source files.
Use HTTPS for every request. It protects the key while it travels between the app and server. Do not log full keys in error reports or server logs.
Give each app its own key. This makes use easier to track and limits harm from one leak. Set the smallest access scope that the app needs.
Rotate keys on a set plan and after staff changes. Revoke a key as soon as you suspect a leak. Test the new key before removing the old one.
- Keep secret keys on the server
- Use HTTPS for all API traffic
- Limit each key by service, source, and quota
- Use OAuth or tokens for sensitive user access
- Hide keys from logs, screenshots, and public code
- Review usage alerts each week
- Revoke leaked keys at once
OAuth often fits user sign-in better. It lets a person grant limited access without sharing a main password. Short-lived tokens can also reduce the time available for misuse.

How to Generate an API Key
How to generate API key credentials depends on the provider. The basic flow stays much the same. Start in the service's developer console.
- Sign in. Open the provider account that owns the project.
- Create a project. Some services ask you to choose a project first.
- Open the key area. Look for a page named API keys, developer tools, or credentials.
- Choose the key type. Pick a public key for limited client access. Pick a private key for server use.
- Add limits. Restrict the key by service, site, app, IP address, or quota.
- Create and copy it. Save the value in a secure store. Many providers show it only once.
- Test the request. Make one small call before using the key in production.
Start with narrow access. You can widen it later when the app needs more features. Narrow limits make leaks less costly.
Do not email a key or place it in a public code store. If the provider offers a key scan, turn it on. Alerts can help you act before a leak grows.
Where to Find Your API Key
Where to find API key details depends on the service. Sign in to its developer console first. Then open the project linked to your app.
Look for labels such as API keys, credentials, access keys, or developer settings. Some services place keys under a security or account menu. The help page can confirm the right path.
If you ask “what is my API key,” do not guess from old code. Check the provider's key list instead. You may need to create a new key if the old one is hidden.
- Open the provider's official developer console
- Select the correct project or app
- Open the credentials or API key page
- Reveal or copy the key if allowed
- Check its limits and last use
- Replace it if you cannot confirm its safety
Never share the full value in a support ticket or screenshot. Mask most characters when asking for help. Revoke the key if it appeared in a public place.