Real-time URL request
Public web data is collected by sending a request with a URL to the Web API. It's also possible to include custom headers, targets, or additional characters if the URL contains non-ASCII characters by supplying request parameters in a valid JSON format. To make a real-time request, use the following syntax:
Nimble APIs requires that a base64 encoded credential string be sent with every request to authenticate your account. For detailed examples, see Web API Authentication.
Every request sent through Nimble API is automatically routed through Nimble IP - our premium proxy network!
Request options
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. |
method | Optional (default = GET) | String | The method for requesting a URL from the target server. |
country | Optional (default = all) | String | Country used to access the target URL, use ISO Alpha-2 Country Codes i.e. US, DE, GB |
state | Optional | String | For targeting US states (does not include regions or territories in other countries). Two-letter state code, e.g. NY, IL, etc. |
city | Optional | String | For targeting large cities and metro areas around the globe. When targeting major US cities, you must include state as well. Click here for a list of available cities. |
locale | Optional (default = EN) | String | LCID standard locale used for the URL request. Alternatively, user can use |
headers* | Optional | String | JSON with key/value structure to pass the required headers. |
cookies | Optional | String | Attach a cookie or cookies to your request. See Sending cookies with a request for details. |
format | Optional (default = JSON) | Enum: JSON | HTML - The data response format. HTML - in case of error, returns JSON with error message. |
parse | Optional (default = false) | Enum: true | false - True - the page's content will be parsed and returned in a JSON format. False - Response will include page headers and raw data (without parsing). When using parse = true, format must be set to “JSON”. |
parser | Optional (default = null) | String | Define a custom parsing template. See Parsing Templates. |
render | Optional (default = false) | Enum: true | false - enables or disables Javascript rendering on the target page. |
render_options | N/A | A collection of rendering-related settings. See Rendering options. |
render_flow | Optional (default = null) | String | Define a series of actions to be performed on the page prior to data collection. See Page Interactions. |
is_xhr | Optional (default = false) | Boolean | Instructs the Web API that the target page is an XHR request instead of a standard webpage (only available when |
consent_header | Optional (default = false) | Boolean | Adds scraping consent header letting the target website know it is being scraped by Nimble. |
* Please do not include any cookies when sending custom headers. To send cookies, please see the Sending cookies with a request section.
Response
Headers
X-Task-ID: string
Payload examples:
If parsing was disabled or omitted in the request, the result data will be the raw HTML of the page you requested. If parsing was enabled, a JSON object with a parsed version of the page will be delivered, with the raw HTML included under the html_content
property.
200 OK
500 Error
400 Input Error
Response Codes
Status | Description |
---|---|
200 | OK |
400 | The requested resource could not be reached |
401 | Unauthorized/invalid credental string |
500 | Internal service error |
501 | An error was encountered by the proxy service |
Last updated