pub struct TwelveDataClient { /* private fields */ }Expand description
Client for Twelve Data API
Provides OHLCV time series data, real-time quotes, and cryptocurrency prices. Free tier: 800 API calls/day
§Example
ⓘ
use ruvector_data_framework::TwelveDataClient;
let client = TwelveDataClient::new(Some("YOUR_API_KEY".to_string()))?;
let series = client.get_time_series("AAPL", "1day", Some(30)).await?;Implementations§
Source§impl TwelveDataClient
impl TwelveDataClient
Sourcepub fn new(api_key: Option<String>) -> Result<Self>
pub fn new(api_key: Option<String>) -> Result<Self>
Create a new Twelve Data client
§Arguments
api_key- Optional Twelve Data API key (get from https://twelvedata.com/)
Sourcepub async fn get_time_series(
&self,
symbol: &str,
interval: &str,
limit: Option<usize>,
) -> Result<Vec<SemanticVector>>
pub async fn get_time_series( &self, symbol: &str, interval: &str, limit: Option<usize>, ) -> Result<Vec<SemanticVector>>
Get OHLCV time series data
§Arguments
symbol- Stock ticker symbolinterval- Time interval (1min, 5min, 1day, 1week, 1month)limit- Number of data points (max 5000)
Sourcepub async fn get_crypto(&self, symbol: &str) -> Result<Vec<SemanticVector>>
pub async fn get_crypto(&self, symbol: &str) -> Result<Vec<SemanticVector>>
Auto Trait Implementations§
impl Freeze for TwelveDataClient
impl !RefUnwindSafe for TwelveDataClient
impl Send for TwelveDataClient
impl Sync for TwelveDataClient
impl Unpin for TwelveDataClient
impl !UnwindSafe for TwelveDataClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more