Search.byquery: Difference between revisions

From Safe Creative API
Jump to navigation Jump to search
w>Jguillo
No edit summary
m 8 revisions imported
 
(4 intermediate revisions by one other user not shown)
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 =  
Line 45: Line 44:
** '''machine-url''': URL to this work API info response (see [[work.get]])
** '''machine-url''': URL to this work API info response (see [[work.get]])


= Sample =
= Example =
REQUEST:
REQUEST (searching for ''"Creative Commons" music''):


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


RESPONSE:
RESPONSE:
Line 57: Line 56:
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<listpage>
<listpage>
   <recordtotal>58302</recordtotal>
   <recordtotal>36781</recordtotal>
   <pagetotal>2333</pagetotal>
   <pagetotal>1472</pagetotal>
   <list>
   <list>
     <work>
     <work>
Line 96: Line 95:
     [...]
     [...]
     <work>
     <work>
       <code>0910074647370</code>
       <code>0910034623680</code>
       <title>Rogi feat. DoMe - Der Praediger von Jerusalem</title>
       <title>Patterns in the Sky</title>
       <authors>
       <authors>
         <author>
         <author>
           <code>0910070058521</code>
           <code>0909300055959</code>
           <name>Rogi feat DoMe</name>
           <name>Bruce H. McCosar</name>
           <human-url>http://www.safecreative.org/user/0910070058521</human-url>
           <human-url>http://www.safecreative.org/user/0909300055959</human-url>
         </author>
         </author>
       </authors>
       </authors>
       <rights-holders>
       <rights-holders>
         <rights-holder>
         <rights-holder>
           <code>0910070058521</code>
           <code>0909300055959</code>
           <name>Rogi feat DoMe</name>
           <name>Bruce H. McCosar</name>
           <human-url>http://www.safecreative.org/user/0910070058521</human-url>
           <human-url>http://www.safecreative.org/user/0909300055959</human-url>
         </rights-holder>
         </rights-holder>
       </rights-holders>
       </rights-holders>
       <thumbnail>https://thumbnails-safecreative-org.s3.amazonaws.com/1/00000124/2e31/7285/5b20/906aec33258e/012020Rogi20feat20DoMe2020Rogi20feat20DoMe2020Der20Praediger20von20Jer_thumb.png</thumbnail>
       <thumbnail>https://thumbnails-safecreative-org.s3.amazonaws.com/1/00000124/1c03/4234/3560/bf36461b6c31/012020Bruce20H20McCosar2020Patterns20in20the20Sky_thumb.png</thumbnail>
       <license>
       <license>
         <code>http://creativecommons.org/licenses/by-sa/2.0/de/</code>
         <code>http://creativecommons.org/licenses/by-sa/3.0/</code>
         <name>Attribution-Share Alike 2.0 Germany</name>
         <name>Creative Commons Attribution Share Alike 3.0</name>
         <shortname>CC by-sa 2.0 de</shortname>
         <shortname>CC by-sa</shortname>
         <human-url>http://creativecommons.org/licenses/by-sa/2.0/de/legalcode</human-url>
         <human-url>http://creativecommons.org/licenses/by-sa/3.0/legalcode</human-url>
         <features>
         <features>
           <timelimited>NOT_APPLICABLE</timelimited>
           <timelimited>NOT_APPLICABLE</timelimited>
Line 126: Line 125:
         </features>
         </features>
       </license>
       </license>
       <human-url>http://www.safecreative.org/work/0910074647370</human-url>
       <human-url>http://www.safecreative.org/work/0910034623680</human-url>
       <machine-url>http://www.safecreative.org/v2/?component=work.get&amp;code=0910074647370</machine-url>
       <machine-url>http://www.safecreative.org/v2/?component=work.get&amp;code=0910034623680</machine-url>
     </work>
     </work>
   </list>
   </list>

Latest revision as of 08:07, 7 May 2021

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>