Search.byquery: Difference between revisions

From Safe Creative API
Jump to navigation Jump to search
w>Jguillo
No edit summary
w>Jguillo
No edit summary
Line 10: Line 10:
* '''Timestamp:''' Ztime is not required
* '''Timestamp:''' Ztime is not required
* '''API trust level''': Public
* '''API trust level''': Public
* '''API server''': <code><nowiki>http://api-search.safecreative.org</nowiki></code>


= Parameters =  
= Parameters =  

Revision as of 08:50, 8 February 2017

Search for works using a query as in the search web page at http://search.safecreative.org

In the search query you can include several terms, space-separated. To search for an exact phrase, enclose it with double quotes (").

Results are paginated

Info

  • Component name: search.byquery
  • Signature: No signature required
  • Timestamp: Ztime is not required
  • API trust level: Public

Parameters

  • query*: Search query
  • page: Page number
  • locale: Locale for work type, license names,...

* Required parameter

Returns

Paginated list of work elements

  • work
    • code: Safe Creative work code
    • title: Work title
    • authors: List of authors
      • author
        • code: Author's Safe Creative user code
        • name: Author's full name
        • human-url: URL to the author's Safe Creative public profile
    • rights-holders: List of rights holders
      • rights-holder
        • code: Rights holder's Safe Creative user code
        • name: Rights holder's full name
        • human-url: URL to the rights holder's Safe Creative public profile
    • thumbnail: URL to the work thumbnail (if any)
    • license: Work license
      • code: License code
      • name: License name
      • shortname: License short name
      • human-url: URL to license text
      • features: License features (see user.licenses
    • human-url: URL to this work web page in Safe Creative
    • machine-url: URL to this work API info response (see work.get)

Example

REQUEST (searching for "Creative Commons" music):

https://search.safecreative.org/v2/
?component=search.byquery
&query=%22Creative+Commons%22+music

RESPONSE:

<?xml version="1.0" encoding="UTF-8"?>
<listpage>
  <recordtotal>36781</recordtotal>
  <pagetotal>1472</pagetotal>
  <list>
    <work>
      <code>0910074648315</code>
      <title>névroses (disco mix)</title>
      <authors>
        <author>
          <code>0910070058439</code>
          <name>Pierre Miss Daisy Black</name>
          <human-url>http://www.safecreative.org/user/0910070058439</human-url>
        </author>
      </authors>
      <rights-holders>
        <rights-holder>
          <code>0910070058439</code>
          <name>Pierre Miss Daisy Black</name>
          <human-url>http://www.safecreative.org/user/0910070058439</human-url>
        </rights-holder>
      </rights-holders>
      <thumbnail>https://thumbnails-safecreative-org.s3.amazonaws.com/1/00000124/2e41/4ec3/a029/8b662f279d78/112020Miss20Daisy20Black2020nevroses2028disco20mix29_thumb.png</thumbnail>
      <license>
        <code>http://creativecommons.org/licenses/by-nc-sa/3.0/</code>
        <name>Creative Commons Attribution Non-Comercial Share Alike 3.0</name>
        <shortname>CC by-nc-sa</shortname>
        <human-url>http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode</human-url>
        <features>
          <timelimited>NOT_APPLICABLE</timelimited>
          <recognition>YES</recognition>
          <distribution>YES</distribution>
          <derivations>INHERITANCE</derivations>
          <commercial>NO</commercial>
        </features>
      </license>
      <human-url>http://www.safecreative.org/work/0910074648315</human-url>
      <machine-url>http://www.safecreative.org/v2/?component=work.get&code=0910074648315</machine-url>
    </work>
    [...]
    <work>
      <code>0910034623680</code>
      <title>Patterns in the Sky</title>
      <authors>
        <author>
          <code>0909300055959</code>
          <name>Bruce H. McCosar</name>
          <human-url>http://www.safecreative.org/user/0909300055959</human-url>
        </author>
      </authors>
      <rights-holders>
        <rights-holder>
          <code>0909300055959</code>
          <name>Bruce H. McCosar</name>
          <human-url>http://www.safecreative.org/user/0909300055959</human-url>
        </rights-holder>
      </rights-holders>
      <thumbnail>https://thumbnails-safecreative-org.s3.amazonaws.com/1/00000124/1c03/4234/3560/bf36461b6c31/012020Bruce20H20McCosar2020Patterns20in20the20Sky_thumb.png</thumbnail>
      <license>
        <code>http://creativecommons.org/licenses/by-sa/3.0/</code>
        <name>Creative Commons Attribution Share Alike 3.0</name>
        <shortname>CC by-sa</shortname>
        <human-url>http://creativecommons.org/licenses/by-sa/3.0/legalcode</human-url>
        <features>
          <timelimited>NOT_APPLICABLE</timelimited>
          <recognition>YES</recognition>
          <distribution>YES</distribution>
          <derivations>INHERITANCE</derivations>
          <commercial>YES</commercial>
        </features>
      </license>
      <human-url>http://www.safecreative.org/work/0910034623680</human-url>
      <machine-url>http://www.safecreative.org/v2/?component=work.get&code=0910034623680</machine-url>
    </work>
  </list>
</listpage>