interface ScraperOptions {
    fetch: {
        (input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
        (input: string | Request | URL, init?: RequestInit): Promise<Response>;
    };
    rateLimitStrategy: RateLimitStrategy;
    transform: Partial<FetchTransformOptions>;
}

Properties

fetch: {
    (input: RequestInfo | URL, init?: RequestInit): Promise<Response>;
    (input: string | Request | URL, init?: RequestInit): Promise<Response>;
}

An alternative fetch function to use instead of the default fetch function. This may be useful in nonstandard runtime environments, such as edge workers.

Type declaration

    • (input: RequestInfo | URL, init?: RequestInit): Promise<Response>
    • Parameters

      • input: RequestInfo | URL
      • Optionalinit: RequestInit

      Returns Promise<Response>

    • (input: string | Request | URL, init?: RequestInit): Promise<Response>
    • Parameters

      • input: string | Request | URL
      • Optionalinit: RequestInit

      Returns Promise<Response>

rateLimitStrategy: RateLimitStrategy

A handling strategy for rate limits (HTTP 429).

transform: Partial<FetchTransformOptions>

Additional options that control how requests and responses are processed. This can be used to proxy requests through other hosts, for example.