1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! # Twelve Data API Client
//!
//! This crate provides a client for the [Twelve Data API](https://twelvedata.com/docs).
//!
//! The Twelve Data API provides financial market data for developers.
//!
//! ## Quick Start
//!
//! - First subscribe to the [Twelve Data API](https://rapidapi.com/twelvedata/api/twelve-data1).
//! - Then create a new client with your API key.
//!
//! ```rust
//! use twelvedata::Client;
//!
//! #[tokio::main]
//! async fn example() {
//! let client = Client::new("TOKEN_HERE");
//! let price = client.realtime_price("AAPL").await;
//! println!("{}", price);
//! }
//! ```
//! - Run the program. It should return the current stock price of AAPL.
//! - Now you can start using the client to get data from the Twelve Data API.
//!
//! ## Notes
//! - You need an async runtime to use this crate. I recommend [tokio](https://tokio.rs/) (as used above).
//! - This crate is not yet complete. I will be adding more endpoints in the future.
//! - Paid endpoints are not yet supported. But will be put behind a feature flag when they are.
/// Core Twelve Data
/// Reference Twelve Data
/// Client for the Twelve Data API