Google Sheets V4 API - Query Google Sheets by Search Criteria(s) - google-sheets

I am integrating my Spring Boot API with Google Sheets API, and was curious to see if anyone know of a good way to query the spreadsheet by criteria.
From what I can observe, I don't see a good way to actually achieve this. The only way I can think of is to retrieve the whole data back, and then filter out the results based on the search parameters. But this could become an issue if the data becomes too large (let's say if the spreadsheet has 30000 rows).
Thank you in advance, and please let me know if you have a better idea that could achieve this!

Related

I need to integrate Google cloud translation API to google sheets using macros

I Cant find any workable solution. Can anyone help? Need to make translate from 1st sheet in one doc to the second. About 60.000 changeable rows.
You can use the Google Translate function directly in your sheet
If you want more advanced/customized calls, I recently wrote an article where I use the current user credential and I call a Google Cloud API (not the translate, but the principle is the same)

How to scrape an income statement from Yahoo Finance into google sheets

I'm trying to scrape an income statement for Apple (AAPL) into google sheets
https://finance.yahoo.com/quote/AAPL/financials?p=AAPL
First off I'd like to say I'm new to using anything technical or function related for computers so sorry if its a dumb question but I'm aware sheets has built in import functions for web data and I tried using the IMPORTXML function and I couldn't find the right xpath for the whole income statement
So my questions are
Which Import function would be best for scraping the income statement into sheets
Whichever function is the best how can I do it.
Would I repeat the steps that you show me if I wanted to scrape the balance sheet and cash flow as well
Thank you for your time
It seems that you are trying to fetch dynamically generated data in the link you've provided. Import functions cannot be used or cannot function properly in dynamically generated data as well as in websites which data are being controlled by JavaScript.
I suggest finding another link or website that will provide you with the same data and can be fetched through IMPORT functions by taking into consideration the mentioned limitations above.

VBA macro to create a list of all URLs connected with one google sheet

Not sure if anyone knows how to do this but could really do with your help,
I have a google sheet that contains 4 or 5 sheets at the moment and that number will increase as we go on,
I have a fantastic piece of code I found that can pull in the data from a Google Sheet Tab using the URL,
however it only does the one tab,
so I was wondering if anyone knows a way to create a list of all the tabs in a google sheets URL's
here is a URL to the first sheet
https://docs.google.com/spreadsheets/d/1G-2PJHClHmI0hrYsV1QxNDzyXG0Kze0IIxzb_n3n6oQ/edit#gid=303111374
so I need a way to go to this then import the URLs for all other sheets
please help if you can, any ideas would be great, also if you have a better way to pull all sheets into excel I'm all ears.

Get Google Reviews with IMPORTXML function in G Sheets

I'm trying to import to a Google Sheet the number of reviews and average rating of a certain venue on Google Maps.
Taking as an example this page:
https://www.google.com/maps?cid=8807257593070771217
From Chrome's inspector, the XPath for the average should be:
//*[#id='pane']/div/div[1]/div/div/div[1]/div[3]/div[2]/div/div[1]/span[1]/span/span
However it always returns empty.
Any idea why?
PS - This URL redirects to another, but that shouldn't be the problem as the same thing happens with Facebook and it returns the correct values.
Thanks in advance for any help
Per the comments here, you can't. If you want to scrape Google Maps, use Google's officially supported way to do that: their APIs.
You're probably interested in the Place Details, in particular.
If you have access to a businesses Google My Business page you can leverage the API to pull in reviews that way: https://developers.google.com/my-business/content/review-data
Otherwise, https://serpapi.com can scrape Google reviews for you.

Performing Google Search In Spreadsheet And Scraping The SERP Data

I hope that you guys are fine. I want to build a simple spreadsheet and I thought I could be able to make one but blank sheet looks horrible to me. I am sure that you guys are kind enough to help me out.
I want to perform multiple Google search queries in Google spreadsheet and want to parse results of each search (top 10 results of each search)
Something like this: https://www.youtube.com/watch?v=tBwEbuMRFlI
But when I tried his given formula in description to play test, Google returned #Error to me, I don't know why.
Can you guys please help me out in making a simple spreadsheet compatible for multiple queries at once? Like one column for keywords (where I could paste my list of keywords) and then 10 columns of search results. All results for one keyword should come in one row
Something like this:
My 1st Example Query = 1st search result, 2nd search result, 3rd result and so on.
My 2nd Example Query = 1st search result, 2nd search result, 3rd result and so on.
It must be easy to code but yeah, it might be time-consuming and I would be very grateful if anyone of you could help me about it.
Looking forward to your help guys.
The problem is that you want to scrape out of Spreadsheets, that's a bad approach and is almost certainly not going to work. Even if you manage to write a scraper inside that limited environment it will easily be spotted by Google.
As you said time is not a problem, I would suggest another route.
Use a backend tool/script that scrapes the data
Use a backend tool/script that creates/modifies the Google spreadsheet
You can run such a script(s) manually on your PC or from a server full automated using a scheduler/cron job.
To create/modify spreadsheets look here: How do I access the Google Spreadsheets API in PHP?
To scrape Google look here: Is it ok to scrape data from Google results?
So this is PHP as language of choice but you can do the exactly same in Java or Python or C#
There is a third party solution like SerpApi you could use for this. It's a paid API with a free trial.
Google Sheets Add-on: SerpApi - Search Engine Results and Ranks
Example code to extract title from the first result:
=SERPAPI_RESULT("engine=google&q=coffee&location=Austin, Texas, United States&google_domain=google.com&gl=us&hl=en", "organic_results.0.title")

Resources