DocumentationAPI DetailsScrape URLSessions

Sessions

Sessions let you maintain consistent state across multiple scraping requests. When you use a session ID, ScrAPI persists the same IP address, user agent, and any cookies collected - making subsequent requests appear as if they come from the same user.

Set the sessionId parameter to any unique string value. All subsequent requests using the same session ID will share the same context.

When To Use This

  • Web crawling and pagination - Navigate through multiple pages of results while appearing as the same user. This dramatically reduces bot detection triggers.
  • Captcha clearance persistence - After solving a captcha, clearance cookies are saved in the session. Subsequent requests skip captcha challenges without paying the 30-credit solve cost again.
  • Authenticated scraping - After logging in (via browser commands or cookies), the session maintains authentication state across requests.
  • Multi-step workflows - Complete multi-page forms, checkout flows, or wizard interfaces where each step requires context from previous steps.
  • Consistent proxy identity - When using a proxy, the session keeps the same IP address for 10 minutes before rotating. This prevents mid-workflow IP changes that could trigger re-authentication or blocks.

How It Works

  1. Set sessionId to any unique string on your first request.
  2. ScrAPI captures the IP address, user agent, and response cookies.
  3. Use the same sessionId on subsequent requests - the saved context is automatically applied.
  4. If using a proxy, the same IP is maintained for 10 minutes before rotating to prevent pool exhaustion.

Tip: Choose descriptive session IDs to make debugging easier (e.g., crawler-product-list, user-login-flow). Any string value works.

Example: Crawling with Sessions

First request - scrape the product listing page:

{
  "url": "https://example.com/products?page=1",
  "sessionId": "product-crawler"
}

Second request - same session maintains cookies and IP:

{
  "url": "https://example.com/products?page=2",
  "sessionId": "product-crawler"
}

Example Request

GET https://api.scrapi.tech/v1/scrape?url=https://deventerprise.com&sessionId=any_unique_identifier

POST https://api.scrapi.tech/v1/scrape

{
  "url": "https://deventerprise.com",
  "sessionId": "any_unique_identifier"
}
  • Custom Cookies & Headers - Manually set cookies for the first request in a session, or let the session collect them automatically.
  • Captcha Solving - Solve once, persist clearance cookies via sessions to avoid re-solving.
  • Browser Commands - Automate login flows then continue scraping with the authenticated session.
  • Residential Proxy - Sessions maintain the same residential IP for consistent geolocation.
  • Geotargeting - Maintain a geo-located IP across session requests.

Testing

Test this request in the Playground or view the OpenAPI specification.