Overview
The Brave Search API uses API key authentication to secure requests. Every API request must include your subscription token in the request header to authenticate and authorize access.Your API key is confidential and should be kept secure. Never expose it in
client-side code, public repositories, or share it publicly.
Obtaining Your API Key
To get started with the Brave Search API, you’ll need a subscription token:- Subscribe to a plan — Visit the Brave Search API page and choose a plan that fits your needs
- Access your API keys — Once subscribed, navigate to the API Keys section in your dashboard
- Copy your token — Your subscription token will be displayed. Copy it to use in your requests
Authentication Method
All requests to the Brave Search API must include your subscription token in theX-Subscription-Token HTTP header.
Header Format
Code Examples
Here are examples of how to authenticate requests in various programming languages:Best Practices
Secure Storage
Never hardcode your API key directly in your source code. Instead, use environment variables or secure configuration management:Key Rotation
Regularly rotate your API keys as a security best practice. You can generate new keys from your dashboard.Next Steps
API Overview
Learn about available endpoints and features
API Reference
Explore detailed API documentation