Search API

Description

The search api allows you to search the clipart collection by several arguments. The default behavior is to return items descending by date if no arguments given. Advanced calls can also be made to limit the search by query, tags, creator and backwards compatibility with Openclipart IDs. The api offers a non-registered user version and a registered user version. Non-registered users are limited to searching by title. Registered users can also search by tags, creator and Openclipart ID’s. Responses also differ depending on non-registered and registered use. To access the registered version users need to register for the site and include their API key in the header of the API call.

Definition

GET /wp-json/clipart/api

Example Requests

https://permaclipart.org/wp-json/clipart/api

Example Response

Non-registered user:

{
  "page": 1,
  "order": "DESC",
  "orderby": "date",
  "count": 10,
  "pages": 109,
  "items": [
    {
      "fscid": 3365,
      "title": "Hand Blender",
      "permalink": "https://permaclipart.org/clipart/hand-blender/",
      "created": "2006-11-23 19:12:38",
      "svgurl": "https://permaclipart.org/download/3365/"
    }
  ]
}

Registered user:

{ 
   "page":1,
   "order":"DESC",
   "orderby":"date",
   "count":1,
   "pages":0,
   "items":[ 
      { 
         "fscid":88715,
         "title":"Hand Blender",
         "permalink":"http:\/\/freesvgclipart.com\/clipart\/hand-blender\/",
         "created":"2006-11-23 13:12:38",
         "svgurl":"http:\/\/freesvgclipart.com\/download\/88715\/",
         "description":"An electric hand blender from a US Patent drawing",
         "filename":"id-001596---johnny-automatic-hand-blender.svg",
         "filesize":"35862",
         "downloads":"",
         "original":{ 
            "source":"Openclipart",
            "id":1596
         },
         "creators":[ 
            { 
               "name":"johnnyautomatic",
               "permalink":"http:\/\/freesvgclipart.com\/clipart_creator\/johnnyautomatic\/"
            }
         ],
         "tags":[ 
            { 
               "name":"Appliance",
               "permalink":"http:\/\/freesvgclipart.com\/clipart_tag\/appliance\/"
            },
            { 
               "name":"Blender",
               "permalink":"http:\/\/freesvgclipart.com\/clipart_tag\/blender\/"
            },
            { 
               "name":"Externalsource",
               "permalink":"http:\/\/freesvgclipart.com\/clipart_tag\/externalsource\/"
            }
         ]
      }
   ]
}

Arguments

apikey
API key is available for all registered users of the site.
Required: false
Send in header of request.
page
The page number of the result you would like.
Required: false

Example:
https://permaclipart.org/wp-json/clipart/api?page=2

num
The number of results per page to return.
Required: false
Default: 10. Max 25

Example:
https://permaclipart.org/wp-json/clipart/api?page=1&num=15

query
A search query to search collection titles.
Required: false
Example:
https://permaclipart.org/wp-json/clipart/api?page=1&num=10&query=cat
orderby
Required: false
Default: date
Accepts: date, title and rand
Note: Ordering by random will cause pagination to return odd results in used together.

Example:
https://permaclipart.org/wp-json/clipart/api?page=1&num=10&query=cat&orderby=title

order
Required: false
Default: DESC
Accepts: DESC or ASC

Example:
https://permaclipart.org/wp-json/clipart/api?page=1&num=10&query=cat&orderby=title&order=ASC

tags
API key required to use.
Send a comma separated list of the tags to restrict the search to.
Required: false

Example:
https://permaclipart.org/wp-json/clipart/api?page=1&num=10&query=cat&orderby=title&order=ASC&tags=Animal,Fun

creator
API key required to use.
Send a comma separated list of the creator(s) to restrict the search to.
Required: false

Example:
https://permaclipart.org/wp-json/clipart/api?page=1&num=10&query=cat&orderby=title&order=ASC&tags=Animal,Fun&creator=johnnyautomatic

ocalids
API key required to use.
Send a comma separated list of the original Openclipart id’s to return only those items that match those ID’s. Any new clipart added to the site not from Openclipart will use a different id system.

Required: false

Example:
https://permaclipart.org/wp-json/clipart/api?ocalids=1454,1286

0 thoughts on “Search API

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>