Skip to main content

sessemi

Python client and CLI for the Sessemi web scraping API. Scrape sites protected by Cloudflare, DataDome, and Akamai — one line of code.

Install

pip install sessemi

Quick start

from sessemi import Sessemi

client = Sessemi(key="your_api_key")
result = client.scrape(
    "https://www.leboncoin.fr/recherche?category=10",
    stealth=True,   # residential proxy + challenge solving + auto-retry
    country="FR",
)

print(result.content)       # page HTML
print(result.status_code)   # 200
print(result.solved)        # True — challenge was solved

Or from the command line:

export SESSEMI_KEY=your_api_key

sessemi scrape "https://www.idealista.com/en/venta-viviendas/" -c ES
sessemi scrape "https://www.nike.com/w/shoes" -f json -o shoes.json
sessemi credits

Get a free API key at app.sessemi.com.

Client

Sessemi(key, url, timeout, retries)

from sessemi import Sessemi

# From constructor
client = Sessemi(key="your_api_key")

# Or from environment variables
# SESSEMI_KEY, SESSEMI_URL, SESSEMI_TIMEOUT, SESSEMI_RETRIES
client = Sessemi()

client.scrape(url, **kwargs) → ScrapeResult

result = client.scrape(
    "https://www.example.com",
    stealth=True,          # residential proxy + solving + retry (the bypass switch)
    country="FR",          # geo-target; requires a residential pool (set by stealth)
    render=True,           # force browser rendering for JS-heavy pages
    session="my-session",  # persist cookies/IP across requests
    headers={"Accept": "application/json"},
    solve=True,            # enable challenge solving (default with stealth/residential)
    block_resources=True,  # skip images/fonts/css for speed
    wait_for="css:.product-list",  # wait for element before returning
    screenshot=True,       # capture screenshot
)

result.content              # page content (HTML or JSON string)
result.ok                   # True if success and body_size > 0
result.status_code          # HTTP status
result.body_size            # content size in bytes
result.challenge_provider   # "cloudflare", "datadome", "akamai", or ""
result.solved               # True if a challenge was solved
result.credits_charged      # credits used
result.credits_remaining    # credits left this cycle
result.duration_ms          # server-side duration
result.cookies              # response cookies
result.screenshot           # screenshot bytes (if requested)
result.error                # error message on failure

client.scrape_batch(urls, **kwargs) → list[ScrapeResult]

Scrape multiple URLs concurrently using async tasks. Submits all URLs, polls until complete.

results = client.scrape_batch(
    ["https://example.com/1", "https://example.com/2", "https://example.com/3"],
    country="US",
    timeout=300,
)
for r in results:
    print(f"{r.url}{'OK' if r.ok else r.error}")

client.health() → dict

status = client.health()
# {"status": "healthy"}

CLI

sessemi scrape URL [options]
sessemi credits
sessemi health

Options

-c, --country CODE    Country code (FR, US, DE, ES, ...)
-p, --pool POOL       Proxy pool: residential | datacenter
-s, --session NAME    Named session for cookie persistence
-f, --format FMT      Output: html (default) | json
-o, --output FILE     Save to file
-q, --quiet           Suppress status output
--render              Force browser rendering
--screenshot          Capture screenshot (use with -o)
--headers JSON        Custom headers as JSON string
-m, --method METHOD   HTTP method (default: GET)

Examples

# Scrape with geo-targeting
sessemi scrape "https://www.leboncoin.fr/recherche?category=10" -c FR

# JSON output piped to jq
sessemi scrape "https://www.idealista.com/en/" -c ES -f json | jq .

# Save to file
sessemi scrape "https://www.nike.com/w/shoes" -o shoes.html

# Check credits
sessemi credits

Configuration

All config works via constructor args or environment variables:

Env var Default Description
SESSEMI_KEY API key (required)
SESSEMI_URL https://api.sessemi.com API base URL
SESSEMI_TIMEOUT 60 Default timeout per scrape (seconds)
SESSEMI_RETRIES 3 Retry count on failure
SESSEMI_RETRY_ON blocked Comma-separated failure types to retry

Links

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sessemi-1.7.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sessemi-1.7.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file sessemi-1.7.0.tar.gz.

File metadata

  • Download URL: sessemi-1.7.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for sessemi-1.7.0.tar.gz
Algorithm Hash digest
SHA256 5af1ba5c5ea647ab51c3abdc1aab103b4674258526dfb0768d5da77a939650ee
MD5 68f89117b02262637e3d085e7ab52fcc
BLAKE2b-256 0da58fec347e0507fef33077905f7ac1fcc8a46ddbae89e336e6e37720dea9f4

See more details on using hashes here.

File details

Details for the file sessemi-1.7.0-py3-none-any.whl.

File metadata

  • Download URL: sessemi-1.7.0-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for sessemi-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 47c69720385e90bbc819d6d47768e552abebfcb6c59eea9d8be3cf15ccd4ea0c
MD5 4d16a1ce39bde9f2713d71558552bebc
BLAKE2b-256 5e3be947bfbea72c496068e33ff48d4532ecbe2c39345b1d3a4ca17e02c0acd9

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.7.0 This release

2 files

1.6.0

2 files

1.5.0

2 files

1.4.0

2 files

1.3.3

2 files

1.3.1

2 files

1.3.0

2 files

1.2.0

2 files

1.1.1

2 files

1.1.0

2 files

1.0.0

2 files

0.22.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page