We see different results from the Google Programmable Search Engine Custom Search JSON API than from the Customer Search Engine web interface when using the exact same Search Engine ID. In some cases, results are omitted; more often the ordering is different.

Note that this question is not a duplicate of Google API returning different results than website. That issue deals with the Custom Search API returning different results to the standard Google Web Search, which is well explained in https://support.google.com/programmable-search/answer/70392?hl=en. This question deals with why the API differs from the Custom Search Engine’s own web interface when using the same Search engine ID. Nor is it a duplicate of Google CSE returning different results when run from API, which concerns an indexing error.

The results and ordering we are looking are consistently shown in the web interface. How do we recreate these results programmatically using the API?

Example:

With the interactive search for “Le Tennis” here: https://cse.google.com/cse?cx=a0091bc71250e40e5#gsc.tab=0&gsc.q=%22Le%20Tennis%22&gsc.sort=

https://www.letennis.co.uk is ranked top. This is the result we are looking for (and its rank at #1 is important for our application).

The call to the same engine programmatically puts this at #4

% curl "https://customsearch.googleapis.com/customsearch/v1?q=%22Le+Tennis%22&key=***&cx=a0091bc71250e40e5" | grep '"link":'
      "link": "https://www.instagram.com/le_tennis_maresfieldltc/?hl=en",
      "link": "https://gamesetstyle.com/products/le-tennis-trucker-hat",
      "link": "https://fr.wikipedia.org/wiki/Tennis",
      "link": "https://www.letennis.co.uk/",
      "link": "https://www.collinsdictionary.com/us/dictionary/french-english/tennis",
      "link": "https://www.amazon.com/Le-tennis-French-Edition/dp/2745917846",
      "link": "https://www.collinsdictionary.com/dictionary/french-english/tennis-de-table",
      "link": "https://nataliebjewelry.com/products/le-tennis-teardrop-bracelet",
      "link": "https://shopbaselinesocial.com/products/le-tennis-hat",
      "link": "https://www.lingq.com/en/learn-french-online/translate/fr/11506287/jadore-le-tennis/",
0

There are 0 answers