The Nimble Web API provides the ability to enhance your scraping requests by including custom headers or cookies. These can be defined in either string or object format and sent as part of your request to the target domain. This feature is crucial for accessing additional data that may be gated behind specific user settings or preferences stored in cookies, allowing you to interact with the website in a more personalized and context-aware manner.
Why?
Unlock Access to Personalized Data: By including custom headers or cookies, you can retrieve data that is tailored to specific user session contexts, which is often otherwise inaccessible.
Enhance Data Retrieval Capabilities: Support diverse use cases by leveraging cookies and headers to interact with websites in ways that mimic real user behavior, ensuring you capture the most relevant data.
Improve Data Retrieval Efficiency: Reduce the need for additional scraping attempts by ensuring that your initial requests are as comprehensive and accurate as possible, saving time and resources.
Additional Information
Supported by real-time, asynchronous, and batch requests.
Misconfiguration of custom headers or cookies may negatively impact the success rates of your scraping tasks, as improper use may trigger detection by the target website.
This feature is intended for advanced users, so please exercise caution and ensure configurations are accurate.
Request Option
Parameter
Required
Description
url
Required
URL | The page or resource to be fetched. Note: when using a URL with a query string, encode the URL and place it at the end of the query string
headers*
Optional
String | JSON with key/value structure to pass the required headers
method
Required when headers is used to send POST request
Enum | GET, POST.
Use POST to send forms to the target site
body
Required when headers is used to send POST request
Object | JSON with key/value structure or string to pass needed payload
cookies
Optional
String | The cookie string uses a syntax of key1=value1;key2=value2;... format, and does not accept a domain parameter, always defaulting to the requested URL's domain.
OR
List Objects | List of attach cookie objects. The cookie object allows for one or multiple cookies to be set, with each one containing three parameters - key, value, domain
cookies.key
Required when cookies is used
String | The name of the attached cookie
cookies.value
Required when cookies is used
String | The value of the attached cookie.
cookies.domain
Optional
URL | The domain with which this cookie is associated. If a domain is not defined, Nimble will use the requested URL's domain by default.
* Please do not include any cookies when sending custom headers.
Example Request - Sending POST Request with Headers
If you wish to send POST data with your target domain as part of your request, such as when submitting a form, please use the following syntax: