Authentication
Learn how to authenticate your API requests using API keys.
API Keys
DevUtils uses API keys to authenticate requests. Each API key is tied to your account and can be used to access all API endpoints based on your subscription plan.
Your API key carries many privileges, so keep it secure. Do not share your API key in publicly accessible areas such as GitHub, client-side code, or public forums.
Using Your API Key
Include your API key in the Authorization header of every request:
Authorization Headerhttp
Authorization: Bearer YOUR_API_KEYExample request with authentication:
cURL Examplebash
curl -X POST https://api.devutils.io/v1/screenshot \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}'Creating API Keys
To create a new API key:
- Log in to your DevUtils dashboard
- Navigate to API Keys in the sidebar
- Click "Create New Key"
- Give your key a descriptive name
- Copy and securely store your new API key
Important
API keys are only shown once when created. Make sure to copy and store your key securely before closing the dialog.
Security Best Practices
- Never expose API keys in client-side code or public repositories
- Use environment variables to store API keys in your applications
- Rotate your API keys periodically
- Delete unused API keys from your dashboard
- Use separate API keys for development and production environments
Using Environment Variablesjavascript
// Node.js example
const apiKey = process.env.DEVUTILS_API_KEY;
fetch('https://api.devutils.io/v1/screenshot', {
method: 'POST',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ url: 'https://example.com' })
});