Overview
All MentionLab REST API requests require an API key sent in thex-api-key header. Your API key is scoped to a single organization and can access all projects within that organization.
Project-scoped API keys are on the roadmap for Q2 2026.
Get Your API Key
You can retrieve your API key from the dashboard:Sign in to MentionLab
Go to app.mentionlab.io and sign in to your account.
API Key Format
MentionLab API keys use the following format:ml_live_ for production keys.
Using Your API Key
Include your API key in thex-api-key header of every request:
Example
Environment Variables
We recommend storing your API key in environment variables:- Unix/Linux/macOS
- .env file
Always add
.env files to your .gitignore to prevent accidentally committing secrets to version control.Required Headers
| Header | Required | Description |
|---|---|---|
x-api-key | Always | Your API key (format: ml_live_...) |
x-project-id | For project endpoints | Project UUID for project-scoped operations |
Example Request
Project Context
Project-specific endpoints require thex-project-id header so the API knows which project to operate on. You can store a default project ID in your environment if most requests target a single project.
Rate Limits
The MentionLab API implements rate limiting to ensure fair usage and maintain service stability for all users. Understanding these limits helps you design efficient integrations that avoid throttling.Default Rate Limits
All accounts share the same default rate limits:| Metric | Limit |
|---|---|
| Requests per Second | 10 |
| Requests per Minute | 300 |
| Requests per Hour | 10,000 |
If you have a custom agreement with MentionLab, your rate limits may differ from the defaults listed here. Please refer to your agreement documentation for your specific limits.
Rate Limit Headers
Every API response includes headers to help you track your usage:| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests allowed in the current window |
X-RateLimit-Remaining | Requests remaining in the current window |
X-RateLimit-Reset | Unix timestamp when the rate limit resets |
Retry-After | Seconds to wait before retrying (only on 429 responses) |
Handling Rate Limits
When you exceed the rate limit, the API returns a429 Too Many Requests response:
Error Codes
| Code | Description | Action |
|---|---|---|
429 | Rate limit exceeded | Wait for Retry-After seconds and retry |
503 | Service temporarily unavailable | Wait 30 seconds and retry with backoff |
Next Steps
Context Headers
See all header requirements and examples.
REST API Getting Started
Review base URL, JSON requirements, and rate limits.