Using the FinnHub API's "Financials As Reported", I want to retrieve only a specific line item for a specific symbol.
In my Google Sheets spreadsheet, the below formula retrieves all the quarterly financial data reported for symbol AAPL:
https://finnhub.io/api/v1/stock/financials-reported?symbol=AAPL&freq=quarterly&token=<api_key>
The response includes US-GAAP namespaces displayed, for example, as:
concept:"LiabilitiesCurrent".
I want to retrieve only the most recent value of "LiabilitiesCurrent" for symbol AAPL. How can I do this without having to retrieve all the reported financial data?
Related
Is there a way to print out the GICS sector name for a specific share/ETF symbol in google sheets using the GOOGLEFINANCE commands or any other way?
Many thanks
I used this site to find several scraping methods to get data from finviz.
https://decodingmarkets.com/scrape-stock-data-from-finviz/
Extending their logic, I was able to get the company name, and the combined sector/subsector codes
(I originally used the website's scraping techniques to get Dividend data that GoogleFinance formula lacks...)
This formula gets the company name using US ticker symbol in cell C3:
=SUBSTITUTE(INDEX(IMPORTHTML("http://finviz.com/quote.ashx?t="&C3,"table",6),2,1),"*","")
Through trial and error, I found that table 6 has name and sectors. I then referenced the 2nd row and 1st column to get the name.
I found that row 3, column 1 has the sector, subsector and country combined as one value. They use a pipe | delimiter for each break.
Using the split function, I was able to split segment.
=SPLIT(SUBSTITUTE(INDEX(IMPORTHTML("http://finviz.com/quote.ashx?t="&C3,"table",6),3,1),"*",""),"|",true,true)
Its not available from Sheets
Check out the official docs:
https://support.google.com/docs/answer/3093281?hl=en
It has a lot of options but unfortunately, not that one.
If you think it would be useful, then make sure you file a feature request #
https://developers.google.com/issue-tracker
As for any other way
#GSee said it best here: https://stackoverflow.com/a/16525782/10445017
While this question was asked beforehand in the following post:
How to get cid from market and symbol from google finance
The answer didn't actually answer the question. Since google finance no longer allows for historical prices beyond a year unless one inputs the appropriate cid into the URL, how does one get the corresponding cid's in order to directly input into the URL the historical prices of specific times? Is there a table available or something along those lines?
I want to use importrange to pull in just the high/low data during a specific time of the day, ignoring the rest of the days update. Specifically from 8:30am to 2:50pm weekdays only.
=importhtml("http://www.marketwatch.com/investing/stock/aapl"&"?"&"workaround="&INT(NOW()),"table")
So for example, I only want to pull in the specific data starting at 8:30am and ending at 2:50pm
The =importhtml() function doesn't have the have the ability to filter data. The query parameter is for:
query - Either "list" or "table" depending on what type of structure contains the desired data.
You can import the data, then run a =query() on the imported data, using the range that the imported data is displayed in.
That URL only has one table in it, and it's not the data for the aapl stock chart. There are 8 lists in that web page, but none of them are for the data in the aapl stock. You aren't going to be able to scrape that chart with =importurl()
The chart is in a <canvas> tag.
I read up on YQL. However i'm at a loss on how to get blocks of data.
I can get individual stock data fine but how do you get collated data like the FTSE 100 shares, without having to find the symbol for each 100 shares and pulling that data in individually?
Ideally i would have the hundred shares with each of their bits of data.
Thanks in advance,
Ewan
looks like you are right that only one stock can be queried at a time. since the api is restful, you can easily use a for loop in bash and curl all the stocks.
Whenever we query YQL table we need to give the SYMBOLS (tickers) as inputs. However there is a limit to the number of symbols you can enter in one go.
I created an Excel sheet where I read a list of symbols from a sheet and then query with YQL and dump the data in another sheet.
Let's assume you want to pull out historical prices with the following specifications:
Symbol/Ticker : symbol
StartDate
EndDate
The corresponding weblink to extract this info would be (in VBA syntax)
"http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.historicaldata%20where%20symbol%20in%20%28%27 " & symbol & "%27%29%20and%20startDate%20=%20%27" & startDate & "%27%20and%20endDate%20=%20%27" & endDate & "%27&diagnostics=true&env=store://datatables.org/alltableswithkeys"
You can find the Excel sheet present at my blog.
I am using Google Documents List API for searching within documents.
Searching on the google drive ui returns results with most number of occurences of words first. But with api it returns the results with last uploaded date first.
This is the URL which i am using https://docs.google.com/feeds/default/private/full?q=search+term
I also tried with https://docs.google.com/feeds/default/private/full?q=search+term&desc=true but this gave the same results that we were getting earlier i.e. by last uploaded date first.
Can someone guide me with what additional parameters i should be adding to the url
You can use the orderBy query parameter to order the Documents List Feed by certain criteria:
last-modified: Default value, sort by last modified date.
last-accessed: sort by last accessed date.
title: sort by title (this is what you're looking for.
starred: sort documents by their "starred" attribute.