Session ID

The Session ID feature allows you to use the same IP address across multiple API requests. By setting the session_id=12345 parameter in your requests, ZenRows® will ensure that all requests made with the same Session ID are routed through the same IP address for 10 minutes.

This feature is useful for web scraping sites that track sessions or limit IP rotation. It helps simulate a persistent session and avoids triggering anti-bot systems that flag frequent IP changes.

You can use any number from 1 to 99999 for session_id.

Original HTTP Code

By default, the ZenRows API returns standard HTTP codes based on the success or failure of your request. However, websites may provide their own status codes, which can give you valuable information about how the site handled the request (e.g., 403 Forbidden or 500 Internal Server Error).

If you need to retrieve the original HTTP status code returned by the target website, simply enable the original_status=true parameter. This is particularly useful for debugging, understanding site-specific responses, or adapting scraping strategies based on the target site’s behavior.

Return content on error

When working with web scraping, you may encounter errors such as 404 Not Found, 500 Internal Server Error, or 503 Service Unavailable. Even in these cases, the response might contain valuable information, such as error messages or partial content that can aid in debugging.

To access this content despite the error status, you can use the allowed_status_codes parameter. This feature enhances the API’s debugging capabilities by allowing you to retrieve the content associated with specified error codes.

You can specify multiple status codes in a single request by separating them with commas.

Requests using the param allowed_status_codes will incur charges!

POST / PUT Requests

You can send POST and PUT requests using your preferred programming language, and ZenRows® will handle the data forwarding to the target site seamlessly. This allows you to interact with APIs or web forms that require data submission without worrying about the underlying mechanics of HTTP requests.

The response you receive will contain the original content from the target site, including any headers and cookies. This can be particularly useful for maintaining sessions or tracking state during your interactions with web applications.

Accessing headers and cookies will vary based on the method you use to make the request, so refer to the relevant documentation for your programming language or library to handle these elements appropriately.

Plan Usage

To monitor your subscription plan’s usage programmatically, you can call the endpoint /v1/subscriptions/self/details. This allows you to track your API usage in real time, enabling better management of your resources and ensuring you stay within your plan’s limits.

Calls made to this endpoint do not count against your concurrency limits, making it an efficient way to gather usage statistics without impacting your scraping activities.

To use this feature, include your API Key in the request header using X-API-Key. This is necessary for authentication and to ensure that the usage data corresponds to your account.

The previous endpoint /usage is deprecated, so please use the updated endpoint for all future requests to avoid disruptions.

The output will be something similar to this:

{
    "status": "ACTIVE",
    "period_starts_at": "202X-09-02T00:00:00Z",
    "period_ends_at": "202X-10-02T00:00:00Z",
    "usage": 103.815320296,
    "usage_percent": 34,
    "plan": {
        "name": "Business",
        "price": 299.99,
        "recurrence": "MONTHLY",
        "products": {
            "api": {
                "concurrency": {
                    "limit": 100,
                    "usage": 1
                },
                "name": "WebScraping API",
                "usage": 103.7470762335
            },
            "proxy_residential": {
                "name": "Residential Proxies",
                "usage": 0.033588062450952
            },
            "scraping_browser": {
                "name": "Scraping Browser",
                "usage": 0.034656
            }
        }
    },
    "top_ups": []
}

Frequently Asked Questions (FAQ)