# ScraperAPI's Python SDK against SpecStream

Date: 2026-11-10. Client: scraperapi-sdk 1.6.1.

## The one line a user changes

Before:

```
client = ScraperAPIClient("...")
```

After:

```
client = ScraperAPIClient(KEY, api_endpoint="https://api.specstream.ai/scraperapi")
```

One call is one Extract API page read at $0.0008; a failed page is not charged.
A request with no credits left answers 403, as ScraperAPI does.

## Request parameters

Honoured means the check in the Measured column passed on the reply. Accepted, not applied means status 200 and the reply has the form of the same call without the parameter. Refused means the vendor's error body and status.

Counts: 5 honoured, 13 accepted, not applied, 3 refused.

| Parameter | Sent | Verdict | Measured |
|---|---|---|---|
| `url` | `https://en.wikipedia.org/wiki/Web_scraping` | honoured | status 200; the body is the page's HTML |
| `api_key` | the key in the query, as the SDK sends it | honoured | status 200; answered with the page |
| `output_format` | `markdown` | honoured | status 200; the body is markdown, not HTML |
| `output_format` | `text` | honoured | status 200; the body is plain text |
| `url (a page the site does not have)` | a 404 page | honoured | status 404; ScraperAPI's 404 |
| `url (a host that does not resolve)` | an unknown host | refused | status 500; ScraperAPI's 500, not charged |
| `render` | `true` | accepted, not applied | status 200; the reply is the baseline's page |
| `premium` | `true` | accepted, not applied | status 200; the reply is the baseline's page |
| `ultra_premium` | `true` | accepted, not applied | status 200; the reply is the baseline's page |
| `country_code` | `de` | accepted, not applied | status 200; the reply is the baseline's page |
| `session_number` | `123` | accepted, not applied | status 200; the reply is the baseline's page |
| `keep_headers` | `true` | accepted, not applied | status 200; the reply is the baseline's page |
| `device_type` | `mobile` | accepted, not applied | status 200; the reply is the baseline's page |
| `follow_redirect` | `false` | accepted, not applied | status 200; the reply is the baseline's page |
| `wait_for_selector` | `#content` | accepted, not applied | status 200; the reply is the baseline's page |
| `screenshot` | `true` | accepted, not applied | status 200; the reply is the baseline's page |
| `autoparse` | `true` | accepted, not applied | status 200; the reply is the baseline's page |
| `output_format` | `json` | accepted, not applied | status 200; the reply is the baseline's page |
| `output_format` | `csv` | accepted, not applied | status 200; the reply is the baseline's page |
| `api key (wrong key)` | a key that is not one | refused | status 401; ScraperAPI's 401 |
| `url (missing)` | no url | refused | status 400; ScraperAPI's 400 |

## Response fields

Present means the field holds a value in the replies to the calls above. Empty means it is there with no value. Absent means it is not in the reply.

Counts: 3 present, 0 empty, 0 absent.

| Field | State | Measured |
|---|---|---|
| `body` | present | every 200 reply |
| `content-type header` | present | every 200 reply |
| `error body (a sentence of text)` | present | every refused call |
