There are two different ways to use this feature. In the JavaScript API, you can restrict your results to one of four common licenses (just like on Google Image Search). This is done using the setRestriction method, after creating your Image Search searcher. Here's how to restrict to images which have been labeled for reuse with modification:
var searcher = new google.search.ImageSearch();searcher.setRestriction(google.search.ImageSearch.RESTRICT_RIGHTS, google.search.ImageSearch.RIGHTS_MODIFICATION);You can experiment with a live example of this in our Code Playground.
If you're using the JSON API, you can use the as_rights optional parameter to tell the API to include or exclude certain attributions. To perform the same restriction as above, try adding this to your requests:
&as_rights=For a full list of the attribute combinations for each type of license, perform an appropriately restricted search on Google Image Search's advanced search and take a look at the as_rights parameter in the URL on the results page.
(cc_publicdomain|cc_attribute|cc_sharealike|cc_noncommercial).-(cc_nonderived)
Note: Images returned with this filter may still have conditions on the license for use. Please remember that violating copyright is strictly prohibited by the API Terms of Use. For more details, see this article.
Please come visit our IRC channel and support forum and let us know how you've used this feature in your site or app!
Hiç yorum yok:
Yorum Gönder