Skip to main content

Authentication

The MentionMarket API uses API keys to authenticate requests. You can generate an API key from your dashboard or by calling the generateApiKey Firebase function.

API Keys

API keys are used to authenticate all requests to the MentionMarket API. Include your API key in the request URL as a query parameter.
Keep your API keys secure and never commit them to version control. Treat them like passwords.

Generating an API Key

You can generate an API key in two ways:
  1. Log in to your MentionMarket account
  2. Navigate to the API Settings section
  3. Click Generate New API Key
  4. Copy and securely store your new key
Call the generateApiKey Firebase Cloud Function:
const functions = firebase.functions();
const generateKey = functions.httpsCallable('generateApiKey');
const result = await generateKey();
console.log('Your API key:', result.data.apiKey);

Rate Limits

API keys are rate limited to 100 requests per hour. If you exceed this limit, you will receive a 429 Too Many Requests response.

Using Your API Key

Include your API key in all API requests as a query parameter:
curl "https://us-central1-mentionmarket-dddf0.cloudfunctions.net/searchNFLStrikeWord?target_phrase=%22touchdown%22&apiKey=YOUR_KEY"

Security Best Practices

Follow these best practices to keep your API keys secure:

Use Environment Variables

Store API keys in environment variables, never in your code

Rotate Keys Regularly

Generate new keys periodically and revoke old ones

Separate Environments

Use different keys for development, staging, and production

Monitor Usage

Track your API usage to detect unauthorized access

Example: Using Environment Variables

MENTIONMARKET_API_KEY=your_api_key_here

Error Responses

401 Unauthorized
error
Invalid or missing API key
429 Too Many Requests
error
Rate limit exceeded (100 requests/hour)
403 Forbidden
error
API key has been revoked or disabled