Authentication
The MarketGeist API supports two authentication methods: API keys for server-to-server integrations, and Bearer JWT tokens for browser-based applications.
API Key Authentication
API keys are the recommended method for programmatic access. Create and manage keys from your API Keys dashboard.
Key Format
MarketGeist API keys follow the format mg_live_ followed by 48 hexadecimal characters. The mg_live_ prefix makes keys easily identifiable by secret detection tools and code scanners.
Using API Keys
Include your API key in the X-API-Key header of every request:
HTTP Header
X-API-Key: mg_live_your_key_here
cURL Example
curl -H "X-API-Key: mg_live_your_key_here" \ https://marketgeist.com/api/v1/public/reports
Bearer Token Authentication
For browser-based applications using Clerk authentication, you can use JWT Bearer tokens. Include the token in the Authorization header:
Authorization: Bearer eyJhbGciOiJSUzI1NiIs...
Scopes
API keys are created with specific scopes that control which endpoints are accessible. Available scopes:
| Scope | Access |
|---|---|
reports | Generate and read market research reports |
seo | Keywords, SEO audits, trending topics |
competitors | Competitor tracking and monitoring |
signals | Market signals and news intelligence |
market_data | Company profiles, sectors, market data |
social_trends | Social media trends (Reddit, X, TikTok, etc.) |
Security Best Practices
- Never expose API keys in client-side code, Git repositories, or public URLs.
- Use environment variables to store keys in production.
- Rotate keys immediately if you suspect they have been compromised.
- Use the minimum scopes required for your integration.
- Set key expiration dates for temporary integrations.
- Use separate keys for development and production environments.
Key Management
You can create up to 5 active API keys per account. Manage your keys from the API Keys dashboard, where you can:
- Create new keys with custom names and scopes
- Deactivate or delete compromised keys
- Rotate keys (generates a new key, deactivates the old one)
- View usage statistics per key
Frequently Asked Questions
How do I get a MarketGeist API key?
Sign in to MarketGeist, go to Dashboard → API Keys, and click "Create Key". You'll receive your key immediately.
Can I use multiple API keys?
Yes, you can create up to 5 active API keys per account, each with different scopes and names.