Authentication
The PostCapture API uses API keys to authenticate requests. Every request must include a valid key.
Creating API Keys
API keys are managed from your PostCapture dashboard. To create a key:
- Sign in to your PostCapture account
- Navigate to Dashboard → API
- Click Create New Key and give it a name
- Copy the key immediately — it is only shown once
All keys are prefixed with sk_ for easy identification.
Passing the Key
Include your API key as a query parameter named apiKey:
1curl "https://postcapture.com/api/screenshot?postUrl=YOUR_POST_URL&apiKey=sk_your_api_key"
Security Best Practices
Never expose your API key in client-side code, public repositories, or browser requests. API keys carry the same access as your account.
- •Use environment variables. Store keys in
.envfiles and load them at runtime. - •Server-side only. Make API calls from your backend, never directly from the browser.
- •Rotate keys regularly. If a key is compromised, delete it from the dashboard and create a new one.
- •Use descriptive names. Name keys after the service or environment (e.g., “production-backend”, “staging”).
Authentication Errors
400Missing API Key
1{2 "error": "Missing required parameter: apiKey"3}
401Invalid API Key
1{2 "error": "Invalid API key",3 "details": "KEY_NOT_FOUND"4}