Social Scraper

Authentication

Learn how to authenticate your API requests using API keys.

Authentication

The Social Scraper API uses API keys to authenticate requests. You must include your API key in every request to access the API endpoints.

Obtaining an API Key

To get started:

  1. Sign up for an account at your-domain.com
  2. Navigate to your dashboard
  3. Generate a new API key

Keep your API key secure. Never expose it in client-side code or public repositories.

Using Your API Key

Include your API key in the Authorization header of every request:

Authorization: Bearer YOUR_API_KEY

Example Request

curl -X GET "https://api.your-domain.com/instagram/profile/username" \
  -H "Authorization: Bearer sk_live_abc123..."

JavaScript Example

const response = await fetch('https://api.your-domain.com/instagram/profile/username', {
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  }
});

const profile = await response.json();

API Key Best Practices

PracticeDescription
Use environment variablesStore API keys in environment variables, not in code
Rotate keys regularlyGenerate new keys periodically for security
Use separate keysUse different keys for development and production
Monitor usageCheck your dashboard for unusual activity

Authentication Errors

If your API key is missing or invalid, you'll receive one of these responses:

Missing API Key

{
  "error": "unauthorized",
  "message": "API key is required"
}

Status Code: 401 Unauthorized

Invalid API Key

{
  "error": "unauthorized",
  "message": "Invalid API key"
}

Status Code: 401 Unauthorized

Rate Limits

API keys are subject to rate limiting. See the Errors page for details on rate limit responses.

On this page