Skip to main content

1. Install and construct the client

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.
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

The full list of functions for X, Reddit, LinkedIn, and GitHub.

Errors

Robust, typed error handling.