Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google search API. Filter license

I want to search images using google API under specific licenses. But looking on the API documentation I can't understand how to use it properly. I want to search:

  • free to use or share, even commercially
  • free to use, share or modify, even commercially

In the documentation I see

  • cc_publicdomain
  • cc_attribute
  • cc_sharealike
  • cc_noncommercial
  • cc_nonderived

https://developers.google.com/custom-search/json-api/v1/reference/cse/list

Can someone tell me what my request should be look like?

like image 621
Djumpen Avatar asked Dec 03 '15 18:12

Djumpen


1 Answers

Official site of creative commons contain a description of each CC license types.
You can use "cc_publicdomain", "cc_attribute" and "cc_sharealike" like "free to use, share or modify, even commercially"
and "cc_nonderived" like "free to use or share, even commercially".
To set license in the request you can use "rights" parameter and pass target license types by url encoded comma.
Like in this request:


    GET https://www.googleapis.com/customsearch/v1?q=swollen+members+night+vision&cx=004646395488064118990%3Aachgbwsn6na&rights=cc_publicdomain%2Ccc_attribute&searchType=image&fields=items&key={YOUR_API_KEY}

Also you can try online "any" google service here and create usable to you requests here

like image 152
Urgotto Avatar answered Oct 02 '22 23:10

Urgotto