@squidcloud/client
    Preparing search index...

    Class WebClient

    WebClient provides methods to interact with web-related functionalities.

    Index

    Methods

    • Search the web using AI. Returns a response containing Markdown text and cited URLs.

      Parameters

      • query: string

        The keywords or query string to search for.

      Returns Promise<WebAiSearchResponse>

    • Creates a shortened URL for the given URL.

      Defaults to a 30 day expiration if no expiry is provided via the secondsToLive field. If secondsToLive is set to 0, the URL will never expire.

      Parameters

      • url: string

        The URL to shorten. It must be a valid URL and should include the protocol (start with http:// or https://).

      • OptionalsecondsToLive: number

        Seconds to live for the shortened URL. If set to 0, the URL will never expire. Defaults to 30 days.

      Returns Promise<WebShortUrlResponse>

    • Creates shortened URLs for the given URLs.

      Defaults to a 30 day expiration if no expiry is provided via the secondsToLive field. If secondsToLive is set to 0, the URL will never expire.

      The parameter arrays should be of the same length and in the same order

      Parameters

      • urls: string[]

        The URLs to shorten. It must be a valid URL and should include the protocol (start with http:// or https://).

      • OptionalsecondsToLive: number

        Seconds to live for each shortened URL. If set to 0, the URL will never expire.

      Returns Promise<WebShortUrlBulkResponse>

    • Deletes a shortened URL by its ID.

      The ID is the unique identifier at the end of the shortened URL.

      Parameters

      • id: string

        The ID of the shortened URL to delete.

      Returns Promise<void>

    • Deletes shortened URLs by their IDs.

      The ID is the unique identifier at the end of the shortened URL.

      Parameters

      • ids: string[]

        The IDs of the shortened URL to delete.

      Returns Promise<void>

    • Fetch content from a URL.

      Parameters

      • url: string

        The URL to fetch content from.

      Returns Promise<string>