web3data.handlers.base

This module contains the API handler’s base class.

class web3data.handlers.base.BaseHandler(chain: web3data.chains.Chains)[source]

Bases: object

The API handler base class.

This class defines the basic methods of performing REST API endpoint queries as well as RPC queries, which are implemented across all handler classes to standardize API requests.

LIMITED = (<Chains.AION: 1>, <Chains.BTC: 2>, <Chains.BCH: 3>, <Chains.BSV: 4>, <Chains.LTC: 7>, <Chains.XLM: 8>, <Chains.ZEC: 9>)
static raw_query(base_url: str, route: str, headers: Dict[str, str], params: Dict[str, str]) → Dict[source]

Perform an HTTP GET request on an API REST endpoint.

Parameters
  • base_url – The API base URL (common prefix)

  • route – The endpoint route after the base (variable suffix)

  • headers – Headers to attach to the API request

  • params – Query parameters to attach to the URL

Returns

The API response parsed into a dict