internetarchive-ts - v0.1.0
    Preparing search index...

    Type Alias WaybackCdxOptions<T>Beta

    type WaybackCdxOptions<T extends WaybackCdxField[] | undefined> = {
        collapse?: WaybackCdxCollapseOption | WaybackCdxCollapseOption[];
        fastLatest?: true;
        filter?: WaybackCdxFilter | WaybackCdxFilter[];
        fl?: T;
        from?: string | Date;
        lastSkipTimestamp?: true;
        limit?: number;
        matchType?: WaybackCdxMatchType;
        offset?: number;
        page?: number;
        pageSize?: number;
        resumeKey?: string;
        showDupeCount?: true;
        showNumPages?: boolean;
        showPagedIndex?: true;
        showResumeKey?: boolean;
        showSkipCount?: true;
        sort?: "regular" | "reverse" | "closest";
        to?: string | Date;
    }

    Type Parameters

    Index

    Properties

    Collapses the results based on the field contents or substring of the field content. Add one or more collapse items by either specifying the field name or :N where N is a positive integer and specifies that the first N characters of the field value are used for collapsing

    fastLatest?: true

    Advanced Option: Return some number of latest results for an exact match. This option and is faster than the standard last results search. The number of results is at least 1 so limit=-1 implies this setting. The number of results may be greater >1 when a secondary index format (such as ZipNum) is used, but is not guaranteed to return any more than 1 result. Combining this setting with limit= will ensure that no more than N last results.

    It is possible to filter on a specific field or the entire CDX line (which is space delimited). Filtering by specific field is often simpler. Any number of filter params of the following form may be specified: filter=[!]field:regex may be specified. Optional: ! before the query inverts the match, that is, will return results that do NOT match the regex.

    "!statuscode:200" // Returns all items with a statuscode that is not 200
    
    fl?: T

    List of fields to return, must be of type WaybackCdxField

    If not defined, all fields are returned.

    from?: string | Date

    Filter by date. If defined, query will return items from the specified date NS later. Can be either a Date object or a 14-digit archive timestamp in the format yyyyMMddhhmmss

    lastSkipTimestamp?: true
    limit?: number

    Return the first n results. Use -N to return the last n results

    10 // return the first 10 results.
    
    -10 // return the last 10 results. The query may be slow as it begins reading from the beginning of the search space and skips all but last N results.
    
    "exact"
    
    offset?: number

    The offset= M param can be used in conjunction with limit to skip the first M records. This allows for a simple way to scroll through the results. However, the offset/limit model does not scale well to large querties since the CDX server must read and skip through the number of results specified by offset, so the CDX server begins reading at the beginning every time.

    page?: number

    Page number If pagination is not supported, the CDX server will return a 400.

    pageSize?: number

    It is possible to adjust the page size to a smaller value than the default by setting the pageSize=P where 1 <= P <= default page size.

    resumeKey?: string

    Resume key

    showDupeCount?: true

    It is possible to track how many CDX lines were skipped due to Filtering and Collapsing by adding the special skipcount counter with showSkipCount = true.

    An optional endtimestamp count can also be used to print the timestamp of the last capture by adding lastSkipTimestamp=true

    showNumPages?: boolean

    To determine the number of pages, add the showNumPages=true param. This is a special query that will return a single number indicating the number of pages

    showPagedIndex?: true

    It is also possible to have the CDX server return the raw secondary index, by specifying showPagedIndex=true. This query returns the secondary index instead of the CDX results and may be subject to access restrictions.

    showResumeKey?: boolean

    Show resume Key

    showSkipCount?: true
    sort?: "regular" | "reverse" | "closest"

    Sort type

    to?: string | Date

    Filter by date. If defined, query will return items up until the specified date. Can be either a Date object or a 14-digit archive timestamp in the format yyyyMMddhhmmss