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

    Class IaSearch<Fields>Beta

    This class represents an archive.org item search using the scrape API endpoint. For more advanced queries, use the IaAdvancedSearch class.

    import { IaSearch } from "internetarchive-ts";
    const search = new IaSearch(session,"computer chronicles",
    {
    fields: ['collection', 'mediatype', 'date'],
    sorts: ["year desc"],
    limit: 30
    });
    console.log(`Total Results: ${await search.getNumFound()}`);
    for await (const result of search.getResultsGenerator()) {
    console.log(result);
    }

    Type Parameters

    • const Fields extends string[] | undefined

    Hierarchy

    Index

    Constructors

    Properties

    fields: string[]
    limit?: number
    numFound: number | undefined
    query: string
    session: IaSession
    sorts?: IaSortOption[]
    url: string

    Methods

    • Beta

      Returns Promise<number>

    • Beta

      Get the number if items found by this query.

      Note that this number can change over time. The number also gets updated with every call to the search API.

      Returns Promise<number>

      Number of items found