How to search for web and images results from Google Custom Search JSON API? - google-api

I'm implementing Google's Custom Search JSON API into my application which shall search for both web and images. I am able to query for web and images independently.
For web: https://www.googleapis.com/customsearch/v1?key=${key}&start=${start}&cx=${cx}&q=${searchVal}
For images: https://www.googleapis.com/customsearch/v1?key=${key}&searchType=image&start=${start}&cx=${cx}&q=${searchVal}
This works perfectly. However, as you can see, I have to make 2 separate requests to get the web results and the images for a single query value. This is an issue since it makes room for Google's search query quota to be exceeded. So, I need to find a way to make a single request which returns me both the web and image results for a particular search value. Any help or recommendation would be appreciated.

Related

How to get list of page URLs with bad metrics Core Web Vitals from Google Search Console via API or other Google API?

How to get list of page URLs with bad metrics Core Web Vitals from Google Search Console via API or other Google API ?
There is a report https://search.google.com/search-console/core-web-vitals/drilldown which contains only some sample pages with problematic CLS (not a complete list of pages is displayed). How can I get a complete list of problem pages via API?
I tried to use https://developers.google.com/webmaster-tools/v1/searchanalytics/query?apix_params=%7B%22siteUrl%22%3A%22https%3A%2F%2Fwww.example.com%22%2C%22resource%22%3A%7B%22startDate%22%3A%222022-03-09%22%2C%22endDate%22%3A%222022-03-14%22%2C%22dimensions%22%3A%5B%22PAGE%22%5D%7D%7D , but that API not returns Core Web Vitals metrics
As you noted, Search Console only provides a limited list of sample URLs and the API doesn't include Core Web Vitals data.
There are a couple of ways to figure out which pages have poor CWV:
Measure CWV on your website directly (see web-vitals.js) and use an analytics service to aggregate the data by page.
Get a list of every URL on the website and query each one using the CrUX API. A tool like this can automatically crawl your sitemap and write the CWV results to a spreadsheet.

User search in RESTful spring API

So basically, I have a spring API with MySQL database and I need to be able to perform search of a user by his name in front-end web app which is using my API. The trick is that I need a kind of google search so by typing, lets say, 3 letters, list of all users who's name starts from these 3 letters would be returned from the API to the web app. By typing or deleting any letter, list should change dynamically.
My question is how can implement this kind of "dynamic" search in my API. What should requests look like? What should the whole architecture of the process in the API look like?
There are a number of ways to pull this off. Coding this in your API is probably going to be the least efficient. I would recommend using SOLR or Lucene to index the data you want to search on. Your front-end will have some JS that will update your list when characters are entered or deleted in the text field.
JQuery provides a plugin that might be just what you're looking for from the UI.
https://jqueryui.com/autocomplete/

Youtube Data Analytics API Targeted Query For CMS

Before accessing the Youtube API in a script I was using the try-it function for Targeted Queries. With the most simple params, I keep running into a 400 error.
Scopes:
Params (CMS name as both the URL and Name failed):
Errors:
I am a CMS with full admin privileges and I am a content owner.
For Youtube Targeted Queries, the dimensions and metrics must adhere to specific combinations outlined in the Content Owner Reports. I suspect using filters for more descriptive (but smaller) reports, and combining reports is a way to maximize on Youtube's rich dimension and metric offerings. Will post a follow up.

How to retrieve google search results legitimately, can you do this with custom search engine?

I need to retrieve google search results for about 200 phrases per day, legitimately through google's systems. I am using php and have been using googles old web search api: https://developers.google.com/web-search/ though as it clearly states it is now officially deprecated. They want users to move across to the "Custom Search Engine API", which I have signed up to be billed for does not do the same thing, it won't run without a cx parameter, meaning you REQUIRE a custom search engine, which you cannot (any more) set to show google results.
Is there a legitimate way to query google for results any more or am I stranded using the existing API up to its 100 query limit per day until they switch it off?

Google Image Search API: Search by two or more domain restrictions

In Google Image Search (the web interface) you can restrict your search results by a single domain. It appears that the same rule applies to the API (http://code.google.com/apis/imagesearch/v1/reference.html#_methods) but as far as I know, the "one site" rule isn't documented anywhere (other than never mentioning multiple sites).
Does anyone know if it is possible to restrict a search across two or more domain names via the web interface OR the Image Search API?
This is not supported. The Google Image Search API is also being deprecated, so it would be best to search for alternatives anyway.

Resources