Skip to main content

1. Install and construct the client

Replace the placeholder below with a key from your server’s environment or secret store.

2. Make a call

Every scraping method takes a typed request object and returns a typed result. Here we fetch a Reddit user profile:

3. Branch on the result

Methods never throw for API or network errors. Instead they return a discriminated union you narrow with res.type:
Once you check res.type === 'success', TypeScript knows res.data is present and fully typed for that endpoint. In the error branch you get the HTTP status and a human-readable message. The SDK validates inputs before sending a request. Invalid inputs can throw a Zod validation error; see Errors & types.
Branch on res.status (the numeric HTTP code) rather than matching on message — messages are meant for humans and may change. See Errors & types.

Try other platforms

The same shape works across every platform. Swap the namespace and method:

Next steps

Functions

Browse the scraping functions available for each platform.

Errors

Robust, typed error handling.