Skip to main content

tcglookup/
lib.rs

1//! # tcglookup
2//!
3//! The official Rust SDK for the [TCG Price Lookup API].
4//!
5//! Live trading card prices across Pokemon, Magic: The Gathering, Yu-Gi-Oh!,
6//! Disney Lorcana, One Piece TCG, Star Wars: Unlimited, and Flesh and Blood.
7//!
8//! Get a free API key at <https://tcgpricelookup.com/tcg-api>
9//!
10//! ## Quickstart
11//!
12//! ```no_run
13//! use tcglookup::{Client, CardSearchParams};
14//!
15//! #[tokio::main]
16//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
17//!     let client = Client::new("tlk_live_...");
18//!
19//!     let results = client
20//!         .cards()
21//!         .search(CardSearchParams {
22//!             q: Some("charizard".into()),
23//!             game: Some("pokemon".into()),
24//!             limit: Some(5),
25//!             ..Default::default()
26//!         })
27//!         .await?;
28//!
29//!     for card in results.data {
30//!         println!("{} — {}", card.name, card.set.name);
31//!     }
32//!     Ok(())
33//! }
34//! ```
35//!
36//! [TCG Price Lookup API]: https://tcgpricelookup.com/tcg-api
37
38mod client;
39mod error;
40mod resources;
41mod types;
42
43pub use client::{Client, ClientBuilder, RateLimitInfo};
44pub use error::{Error, Result};
45pub use resources::cards::{CardSearchParams, CardsResource, HistoryParams};
46pub use resources::games::{GameListParams, GamesResource};
47pub use resources::sets::{SetListParams, SetsResource};
48pub use types::*;