How to Generate an API Key in MapMetrics
To use MapMetrics services in your application, you need to generate an API key. This key allows your app to securely access MapMetrics features and ensures only authorized usage. Follow the steps below to create your API key:
1. Navigate to the Keys Section
Log in to the MapMetrics Portal and select the Keys section from the sidebar. Here, you will see a list of your existing keys (if any).
2. Start the Key Generation Process
Click the New Key button to begin creating a new API key.
3. Fill in Key Details
You will be presented with a form to configure your new API key. The following options are available:
- Name: Give your key a descriptive name (e.g., "Production Web App", "Test App").
- Allowed Websites: (Optional) Specify which website origins are allowed to use this key. This is a security feature to prevent unauthorized use. For production, set your domain(s) (e.g.,
https://yourdomain.com
). For development or mobile apps, you can leave this blank to allow all origins. - Scope: Select the SDKs and features this key should have access to. Only the selected SDKs/features will be available with this key. For example, you might enable Maps, Search, or Autocomplete depending on your use case.
4. Save and Generate Your Key
After filling in the details and selecting the appropriate scopes, click Save to generate your API key.
5. Copy and Store Your Key
Once your key is generated, it will be displayed on the screen. Copy and save this key in a secure location. You will need it to authenticate your application with MapMetrics services.
Tip: Treat your API key like a password. Do not share it publicly or commit it to public repositories.
You are now ready to use your API key! In the next chapter, you will learn how to create and apply custom map styles.