YQL finance gets null in results - yql

I'm just using one of the sample datatables in the YQL console. The YQL statement is select * from yahoo.finance.stock where symbol="yhoo"
Why am I get null in the results?
Link to YQL console with the YQL statement

It looks like the yahoo.finance.stock YQL data table is no longer working. When run with Diagnostics enabled, several JavaScript errors appear. Because there is no official Yahoo Finance API, this community table is retrieving data by scraping web pages, and is therefore susceptible to page changes causing breakage like this.
The table yahoo.finance.stocks does seem to work, but I'm not sure if the data returned is what you're looking for.
Example query:
select * from yahoo.finance.stocks where symbol="yhoo"

I had better luck with yahoo.finance.stock (singular, no "s"). The data seems to be better maintained.

Related

How do I use importXML/importHTML to retrieve a stock options chain that is hidden?

I am trying to use importXML or importHTML function to retrieve a stock options chain, specifically using this function to get a table. So far, this is what I have:
=importhtml("https://bigcharts.marketwatch.com/quickchart/options.asp?symb=TSLA","table",3)
The problem I'm getting is that I can't retrieve "hidden" tables. For example, if you go on the website: https://bigcharts.marketwatch.com/quickchart/options.asp?symb=TSLA
If you scroll down on this page the hidden tables would only be revealed if you click on ,"show april 2022", "show may 2022", etc. I am trying to retrieve all of this information.
The end result is that I would like to create a table that looks like this:
https://www.barchart.com/stocks/quotes/tsla/put-call-ratios
And a table that looks like this:
https://www.barchart.com/stocks/quotes/TSLA/options?moneyness=10&view=stacked&expiration=2022-04-14-m
As a result, there are two things that I am trying to create, the above tables shown on barchart.
I have tried to use importHTML or importXML on barchart, but it looks like it's not allowed. If there is a way to directly retrieve the information from barchart, that would be a much better solution rather than having to import all of the data separately using a different website.
Please note, that I do have a beginner knowledge, so a step-by-step solution on what to do would be very helpful. Thank you

ImportXML not returning entire table

I cannot get an entire table to populate with ImportXML. At best I get the first column and I cannot figure this out.
The website I am trying to scrape is: https://classic.warcraftlogs.com/character/us/kromcrush/chills
Do I have any options to retrieve the table rather it be column by column or as a whole?
I have tried all the following plus several others.
=IMPORTXML("https://classic.warcraftlogs.com/character/us/kromcrush/chills","//table[#id='boss-table-1010']/tbody/tr")
=IMPORTXML("https://classic.warcraftlogs.com/character/us/kromcrush/chills","//tbody/tr")
=IMPORTXML("https://classic.warcraftlogs.com/character/us/kromcrush/chills","//tbody/tr/td")
=IMPORTXML("https://classic.warcraftlogs.com/character/us/kromcrush/chills","//tr")
=IMPORTXML("https://classic.warcraftlogs.com/character/us/kromcrush/chills","//tr/td")
=IMPORTXML("https://classic.warcraftlogs.com/character/us/kromcrush/chills","//tr/td[1]")
=IMPORTXML("https://classic.warcraftlogs.com/character/us/kromcrush/chills","//tr/td[2]")
Anything outside of column one says Imported content is empty. Please help!
P.S. I have scoured this website and google for answers and every case I find seems to be a syntax error, starting at the table itself doesn't return the entire table which tells me I need a clever method.
It seems that's an issue with the website, because when you click on Inspect you can see the table with id "boss-table-1010" but if you click on View Source that ID is not available, so the table is dynamically rendered and Sheets doesn't find such id.
I've checked it and I can get the data by doing
=IMPORTXML("https://classic.warcraftlogs.com/character/us/kromcrush/chills", "//table/tbody//td")
But if you want a more robust solution, it'll be better doing it programmatically by using Python for web scraping

Google BigQuery with Rails

I want to get the top repositories on Github to display on my Rails App. I think I'm half way through.
This is the code I'm using on Google BigQuery:
SELECT repository_name, repository_url, MAX(repository_forks) as total_forks, MAX(repository_watchers) as total_watchers, repository_language
FROM [publicdata:samples.github_timeline]
GROUP BY repository_url, repository_language, repository_name
ORDER BY total_watchers DESC
LIMIT 100
Is there any way I can get this query's results as a JSON so I can parse them in my Rails app?
Thanks in advance.
There's a Ruby client library for BigQuery here:
https://developers.google.com/bigquery/client-libraries
When you run a query, your results are stored in a temporary table (which you can copy to a permanent table if you'd like to keep them for more than 24 hours). You can read the contents of this table using the tabledata.list API:
https://developers.google.com/bigquery/docs/reference/v2/tabledata/list

Partial keyword searching in Geo APIs

I've been using SimpleGeo for doing some of my place data queries for a location-based app I'm building. They currently use Factual's data set. From what I can tell, there is no way to do partial text queries on place data, probably because of limitations on Factual's end.
The kind of query I mean is that "Starb" would return results for Starbucks in an auto-complete.
Testing out Google Places API yields the same results. Querying "Bullf" for Bullfrog Brewery near Williamsport, PA turns up nothing. Querying "Bullfrog" yields the correct result.
Do any geolocation/place APIs support this kind of partial keyword query?
Google Places does have an Autocomplete API that will return results based on partial keyword queries.
You can view the documentation here:
http://code.google.com/apis/maps/documentation/places/autocomplete.html
Also there's a demo and a blog post about the Places API with Autocomplete here:
http://googlegeodevelopers.blogspot.com/2011/05/places-everybody-show-is-about-to-begin.html

confused how to use opentables in yql

i am trying to get access to whitepages using YQL. Unfortunately i don't have much experience with opentables.
I was directed to the whitepages xml file at:
http://github.com/spullara/yql-tables/blob/c63212b2ac9db6feb77ae3cecace51ed52e08c01/whitepages/whitepages.search.xml
Does anyone know how to use this table to extract meaningful information using YQL?
Specifically, I'm not sure how to make a query in YQL using this table to search for a person's name.
Help?
Go to the YQL console http://developer.yahoo.com/yql/console/ and click Show Community Tables. That should make the list on the right much bigger, and will include your table.
have you tried to put
&env=http%3A%2F%2Fdatatables.org%2Falltables.env
at the end of your request?

Resources