You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The most common use case is to get snapshot price of a portfolio of tickers. It would be nice to have a simple api that takes a number of tickers and returns the last price. It sure can be implemented using existing apis like get_dataframe, but that is going to be inefficient in many ways for following reasons.
You have to guess the correct start date. Creates a problem when 'now' is a holiday or weekend
You end up discarding all the data except the last row for each ticker - reduces network traffic
We most likely only need the adjClose and possibly the time/date of that price - reduces network traffic
What I Did
The text was updated successfully, but these errors were encountered:
This is a good idea regarding saving network traffic! Currently there isn't a way as the user to specify what fields should be returned (like with a GraphQL server), so many fields do end up going unused, perhaps @tiingo may have a take on whether there are any plans to implemented this.
Currently, if both startDate and endDate are omitted from the end-of-day endpoint, you will get the latest price
Until we add a convenience method for this directly to the library (perhaps with parallel fetching or some sort of rate limiting handled in the library), how does this look? Admittedly it has more fields than you requested, but since we can't prevent the backend from sending them yet, I figured it's OK to include them all.
# assuming you instantiated a client = TiingoClient() somewhere up abovedefget_latest_prices(tickers):
return [
client.get_ticker_price(ticker) fortickerintickers
]
@hydrosquall previously you mentioned some sort of rate limiting handled in the library has this been asked before as I'm working on something similar and could try building it.
The one I have now tracks API calls, as n number per month, day, hour, minute options.
Tiingo has the free and pro tier, do we have pro tier features in our code?
Free Tier 500 unique symbols a month 50 requests an hour 1000 requests a day
Description
The most common use case is to get snapshot price of a portfolio of tickers. It would be nice to have a simple api that takes a number of tickers and returns the last price. It sure can be implemented using existing apis like get_dataframe, but that is going to be inefficient in many ways for following reasons.
What I Did
The text was updated successfully, but these errors were encountered: