coinglecko/client

Configuration and client construction for the CoinGecko API.

Types

The API tier determines the base URL and authentication header.

pub type ApiTier {
  Demo
  Pro
}

Constructors

  • Demo
  • Pro

An opaque client holding API configuration. Construct with new_demo or new_pro.

pub opaque type Client

Values

pub fn api_key(client: Client) -> String

Get the API key from the client.

pub fn api_tier(client: Client) -> ApiTier

Get the API tier from the client.

pub fn base_url(client: Client) -> String

Get the base URL from the client.

pub fn new_demo(api_key key: String) -> Client

Create a client for the CoinGecko Demo (free) API.

Example

let client = client.new_demo(api_key: "CG-your-key-here")
pub fn new_pro(api_key key: String) -> Client

Create a client for the CoinGecko Pro (paid) API.

Example

let client = client.new_pro(api_key: "CG-your-pro-key")
Search Document