To use the CB Insights API, you need to authenticate your requests by obtaining an access token. This document explains how to authenticate and use your credentials with the API.
Obtaining Credentials
Before you can authenticate with the API, you need to obtain your client credentials:
Authentication with the CB Insights API uses a client credentials flow. You'll need to make a POST request to our authorization endpoint with your client ID and client secret.
Authentication RequestâEndpoint: POST https://api.cbinsights.com/v2/authorize
curl -X POST https://api.cbinsights.com/v2/authorize \
-H "Content-Type: application/json" \
-d '{
"clientId": "your_client_id",
"clientSecret": "your_client_secret"
}'
import requests
import json
url = "https://api.cbinsights.com/v2/authorize"
payload = {
"clientId": "your_client_id",
"clientSecret": "your_client_secret"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, headers=headers, data=json.dumps(payload))
token_data = response.json()
token = token_data["token"]
print(f"Authentication successful. Token: {token}")
Authentication Responseâ
Upon successful authentication, you'll receive a response containing your access token:
{
"token": "your_access_token"
}
Token Lifecycle
Include the token in the Authorization header of all subsequent API requests:
curl -X POST https://api.cbinsights.com/v2/firmographics \
-H "Authorization: Bearer your_access_token"
Security Best Practicesâ
Store credentials securely: Never hardcode your client ID and secret in your application code or commit them to version control.
Use environment variables: Store your credentials in environment variables or a secure configuration system.
Implement token caching: Cache your token for reuse to avoid unnecessary authentication requests, but ensure you handle expiration appropriately.
Limit access: Only share your credentials with authorized team members and systems.
warning
Troubleshooting
If you encounter authentication issues:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4