Search code examples
google-searchgoogle-custom-searchgoogle-search-api

Filter cse results using labels


I want to get the json response for the domains I already have labeled.

var URL = "https://www.googleapis.com/customsearch/v1?key=**&cx=**&q=allinurl:"+queryUrl+"&fields=items(title,link,snippet)&more:"+label;

When I use that query, my results are the same as if I don't use more:label

The domains in one label aren't in the rest, and the labels have the FILTER mode.


Solution

  • It was my own mistake, the more key has to go within the query (q=) with a +, like this:

    &start="+startResult+"&q=allinurl:"+queryUrl+"+more:"+label