Changelog
July 17, 2026 · View on GitHub
4.0.1 — 2026-07-17
Changed
- Documentation: expanded README — API docs, signup/dashboard links, badges, and links to the other official clients.
4.0.0 — unreleased
Complete rewrite of the official Python client. The previous 3.x releases were generated from the OpenAPI specification; 4.0 is a hand-authored, idiomatic Python package with a much smaller public surface.
Breaking changes
There is no migration shim — 3.x and 4.x are different libraries that happen
to share a name on PyPI. Stay on webscraping_ai == 3.2.1 if you cannot
update your call sites yet.
- The class-per-tag layout (
AIApi,HTMLApi,SelectedHTMLApi,TextApi,AccountApi) is gone. Use a singleClient(orAsyncClient) instead. - All endpoint methods now live directly on the client and use snake_case
names matching the URL path:
Client.html(...),Client.text(...)Client.selected(...),Client.selected_multiple(...)Client.question(...),Client.fields(...)Client.account()
- The configuration object is gone. Pass
api_key(and optionallybase_url,timeout,http_client) directly toClient(...). - The transport stack moved from
urllib3tohttpx. The only runtime dependency is nowhttpx. - Errors moved from a single
ApiExceptionto a typed hierarchy mirroring the documented HTTP status codes:BadRequestError(400),PaymentRequiredError(402),AuthenticationError(403),RateLimitError(429),ServerError(500),GatewayTimeoutError(504), plusAPITimeoutErrorandAPIConnectionErrorfor transport failures. They all share aWebScrapingAIErrorbase class.
Added
AsyncClient— async/await counterpart toClient, sharing the same method signatures and error hierarchy.- Native support for the API's mixed query-string encodings (deepObject for
headers/fields, form+explode forselectors, flat for everything else) via a custom encoder. py.typedmarker; the package ships with type information.