Problem with Google Custom Search API

Need: search google via API and get json result, which mimmics result found when I search on webapi

My settings Custom Search- search the entire network

My searches: Search term: 072745546181(which is a UPC label for some breast-fed chickens) https://www.googleapis.com/customsearch/v1?key=AIzaSyBaPxycT3gj82T5qm66XGgIvtSEP31LISo&cx=015261035819156121642:qj7jmhlymjw&q=072745546181

Web search return (see results) Search term: 072745546181(which is the UPC label for some breast-fed chickens) Example 1:https://www.google.de/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=072745546181

Please note that q=at the end of the sameq=072745546181

There should be a simple answer: what am I doing wrong here?

Conversely, a search with terms such as "President Donald Trump," https://www.googleapis.com/customsearch/v1?key=AIzaSyBaPxycT3gj82T5qm66XGgIvtSEP31LISo&cx=015261035819156121642:qj7jmhlymjw&q=donald trump president

returns a good result with which I can do something. There are no problems here, but why doesn’t this work when searching for the UPC?

What should I do?

1.26.17 - 50 , . ? !

+4
3

. , , , 8 ( ). - SO , - . - , google "" -, . , UPC, , Google, .

, , inurl%3A072745546181, allintitle%3A0727+4554+6181 , , url%3Abuycott.com+072745546181, . , .

, 95% , , , Google .

API , , Bing Web Search API Faroo API

+1

, , .

, , Google .

, Google : https://serpapi.com/

0

It is old but still relevant. You must create a custom search engine for UPC searches here: https://cse.google.com/all

After that, you need to add sites for search (for example, https://www.barcodespider.com , https://www.upcitemdb.com ).

enter image description here

From there you cURL looks like this:

curl -X GET \
  'https://www.googleapis.com/customsearch/v1?key={{googleApiKey}}&cx={{googleUpcSearchEngineCode}}&q=034449787178' \
  -H 'Accept: */*' \
  -H 'Cache-Control: no-cache' \

The query filters the results by searching for the UPC at the specified sites.

~ Greetings

0
source

Source: https://habr.com/ru/post/1667688/


All Articles