Class TorLens

TorLens - A library for fetching and analyzing Tor node information

Constructors

Properties

baseUrl: string

Methods

  • Performs an advanced search with multiple parameters

    Parameters

    • params: Record<string, string>

      The search parameters to use

    Returns Promise<TorDetails>

    Details about matching Tor nodes

  • Gets a bridge by its fingerprint

    Parameters

    • fingerprint: string

      The bridge's fingerprint

    Returns Promise<undefined | TorBridge>

    The bridge data if found, undefined otherwise

  • Fetches bridges by specific transport type

    Parameters

    • transport: string

      The transport type to filter by (e.g., "obfs4")

    Returns Promise<TorBridge[]>

    Array of bridges supporting the specified transport

  • Fetches a specific relay by its fingerprint

    Parameters

    • fingerprint: string

      The relay's fingerprint

    Returns Promise<undefined | TorRelay>

    The relay data if found, undefined otherwise

  • Fetches relays by autonomous system (AS) number

    Parameters

    • asNumber: string

      The AS number with or without the "AS" prefix

    Returns Promise<TorRelay[]>

    Array of relays with the specified AS number

  • Fetches relays by autonomous system (AS) name

    Parameters

    • asName: string

      The AS name to search for

    Returns Promise<TorRelay[]>

    Array of relays with AS names containing the search term

  • Fetches relays by contact information

    Parameters

    • contactInfo: string

      The contact information to search for

    Returns Promise<TorRelay[]>

    Array of relays with matching contact information

  • Fetches relays by country code

    Parameters

    • countryCode: string

      The two-letter country code

    Returns Promise<TorRelay[]>

    Array of relays in the specified country

  • Fetches relays by exit address (IP)

    Parameters

    • exitAddress: string

      The exit address to search for

    Returns Promise<TorRelay[]>

    Array of relays with matching exit address

  • Fetches relays that have specific flags

    Parameters

    • flags: string[]

      Array of flags to filter by

    Returns Promise<TorRelay[]>

    Array of relays with all the specified flags

  • Fetches relays by host name (verified or unverified)

    Parameters

    • hostname: string

      The hostname to search for

    Returns Promise<TorRelay[]>

    Array of relays with matching hostname

  • Fetches relays by minimum bandwidth rate

    Parameters

    • minBandwidth: number

      The minimum bandwidth rate in bytes per second

    Returns Promise<TorRelay[]>

    Array of relays with at least the specified bandwidth rate

  • Fetches relays running for at least the specified duration

    Parameters

    • minDays: number

      The minimum number of days the relay has been running

    Returns Promise<TorRelay[]>

    Array of relays running for at least the specified duration

  • Fetches relays by nickname

    Parameters

    • nickname: string

      The relay nickname to search for

    Returns Promise<TorRelay[]>

    Array of matching relays

  • Fetches relays by OR address (IP:port)

    Parameters

    • orAddress: string

      The OR address to search for

    Returns Promise<TorRelay[]>

    Array of relays with matching OR address

  • Fetches relays by platform (e.g., "Tor 0.4.8.16 on Linux")

    Parameters

    • platform: string

      The platform string to search for

    Returns Promise<TorRelay[]>

    Array of relays with matching platform

  • Fetches relays that allow a specific port

    Parameters

    • port: number

      The port number to check

    Returns Promise<TorRelay[]>

    Array of relays that allow the specified port

  • Fetches relays by unverified host name

    Parameters

    • hostname: string

      The unverified hostname to search for

    Returns Promise<TorRelay[]>

    Array of relays with matching unverified hostname

  • Fetches relays by verified host name

    Parameters

    • hostname: string

      The verified hostname to search for

    Returns Promise<TorRelay[]>

    Array of relays with matching verified hostname

  • Fetches relays by Tor version

    Parameters

    • version: string

      The Tor version to search for

    Returns Promise<TorRelay[]>

    Array of relays with the specified Tor version

  • Fetches relays by version status (e.g., "recommended")

    Parameters

    • status: string

      The version status to filter by

    Returns Promise<TorRelay[]>

    Array of relays with the specified version status

  • Fetches the top relays by consensus weight

    Parameters

    • limit: number = 10

      The maximum number of relays to return

    Returns Promise<TorRelay[]>

    Array of relays sorted by consensus weight (descending)

  • Fetches Tor node details based on a search term

    Parameters

    • Optional searchTerm: string

      The term to search for (nickname, fingerprint, IP address, etc.)

    Returns Promise<TorDetails>

    Details about matching Tor nodes