API Reference

API Keys Authentication

Learn how to authenticate your API requests using API keys

Overview

API keys are used to authenticate requests to the API. Each key is unique to your account and has specific permissions. All API requests must include an API key in the Authorization header.

Your API keys carry many privileges, so be sure to keep them secure. Do not share your API keys in publicly accessible areas such as GitHub, client-side code, or in your browser's developer tools.

Generating API Keys

You can generate API keys from your dashboard under API Keys section. Each key can be configured with specific permissions and a descriptive name for reference.

  1. Navigate to the API Keys section - Go to your project dashboard and select "API Keys" from the sidebar
  2. Click "Generate New Key" - Provide a name and select appropriate permissions for your key
  3. Store your key securely - The full key is only shown once, so make sure to copy and store it securely

Using API Keys

API keys should be included in the Authorization header using the Bearer scheme:

HTTP
Authorization: Bearer sk-brz-yourapikeyhere

Examples

Using curl:

bash
curl -X GET "https://browserize.com/api/browsers" \
  -H "Authorization: Bearer sk-brz-yourapikeyhere" \
  -H "Content-Type: application/json"

Using JavaScript (Node.js):

javascript
const axios = require('axios');

const apiKey = 'sk-brz-yourapikeyhere';

axios.get('https://browserize.com/api/browsers', {
  headers: {
    'Authorization': `Bearer ${apiKey}`,
    'Content-Type': 'application/json'
  }
})
.then(response => {
  console.log(response.data);
})
.catch(error => {
  console.error('Error:', error);
});

Using Python:

python
import requests

api_key = 'sk-brz-yourapikeyhere'
headers = {
    'Authorization': f'Bearer {api_key}',
    'Content-Type': 'application/json'
}

response = requests.get('https://browserize.com/api/browsers', headers=headers)
data = response.json()
print(data)

API Key Security

Follow these best practices to keep your API keys secure:

  • Use environment variables - Store API keys in environment variables, not in your code
  • Restrict permissions - Generate keys with only the permissions they need
  • Rotate keys regularly - Create new keys and deprecate old ones on a schedule
  • Use backend servers - Make API calls from your server, not directly from client-side code

Testing Authentication

You can test if your API key is working correctly with this endpoint:

http
GET https://browserize.com/api/test

A successful response will look like this:

json
{
  "success": true,
  "message": "API key is valid",
  "project_id": "proj_123456789"
}

Troubleshooting

Common authentication error responses and how to fix them:

ErrorPossible Cause
Missing API keyYou didn't include the Authorization header
Invalid API keyThe API key doesn't exist or is incorrectly formatted
Expired API keyThe API key has been revoked or deactivated
Insufficient permissionsThe API key doesn't have permission for the requested operation

Next Steps

Now that you understand API authentication, you can explore: