Request Headers
APIVerve uses HTTP headers for authentication, content negotiation, and request configuration. This guide covers all supported request headers and their usage.
Required Headers
The following header is required for all API requests. See the authentication guide for details on obtaining and managing your API key.
| Header | Required | Description |
|---|---|---|
x-api-key | Yes | Your APIVerve API key for authentication |
x-api-key: your_api_key_hereNever share your API key publicly or commit it to version control. Use environment variables to store your API key securely.
Optional Headers
These headers can be used to customize your requests:
| Header | Accepted Values | Description |
|---|---|---|
Accept | application/json, application/xml, application/yaml | Specifies the desired response format (default: JSON) |
Content-Type | application/json, multipart/form-data | Specifies the format of the request body (for POST requests) |
Accept Header - Response Format
Use the Accept header to specify your preferred response format. If not specified, responses default to JSON.
| Accept Value | Response Format |
|---|---|
application/json | JSON (default) |
application/xml | XML |
application/yaml | YAML |
curl -X GET "https://api.apiverve.com/v1/currencyconverter?from=USD&to=EUR&amount=100" \
-H "x-api-key: YOUR_API_KEY" \
-H "Accept: application/xml"Content-Type Header - Request Body
For POST requests that include a request body, use the Content-Type header to specify the format of your data.
| Content-Type Value | Usage |
|---|---|
application/json | JSON request body (most common) |
multipart/form-data | File uploads |
application/x-www-form-urlencoded | Form data |
curl -X POST "https://api.apiverve.com/v1/emailvalidator" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]"}'curl -X POST "https://api.apiverve.com/v1/imageconverter" \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: multipart/form-data" \
-F "[email protected]" \
-F "format=jpg"Complete Request Example
Here's a complete example showing all commonly used headers:
curl -X GET "https://api.apiverve.com/v1/weatherforecast?city=London" \
-H "x-api-key: YOUR_API_KEY" \
-H "Accept: application/json"const response = await fetch('https://api.apiverve.com/v1/weatherforecast?city=London', {
method: 'GET',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Accept': 'application/json'
}
});
const data = await response.json();Header Case Sensitivity
HTTP headers are case-insensitive according to the HTTP specification. The following variations are all valid:
x-api-keyX-API-KeyX-Api-Key
While headers are case-insensitive, we recommend using lowercase (x-api-key) for consistency and compatibility with HTTP/2, which requires lowercase headers.