Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents


Since a couple of weeks, Spreadshirt API v1 allows you to search for designs on our design marketplace. In this article, I am going to tell you

...

Our search interface for searching on our design marketplace is quite simple. As explained in Speadshirt API v1 Explained, we provide in general a REST interface that gives you access to most of the data you need for creating custom shops, masss-customization applications or widgets in context of customized apparel, like designs, product types or print types.
Looking at designs in special, you can retrieve marketplace design listings without using the search by using either the URL http https://api.spreadshirt.net/api/v1/shops/205909/designs or http https://api.spreadshirt.com/api/v1/shops/93439/designs depending on whether you want to access the designs on the eu or na platform (eu is shop 205909 and na 93439).
Searching for designs is as easy as retrieving design listings: You simply add the query parameter query to the URL and add your search terms as values, e.g. http https://api.spreadshirt.net/api/v1/shops/205909/designs?query=herz mit pfeil (herz mit pfeil is german and means “heart with arrow”).

Besides stating in the query parameter what you are looking for, you can also provide query parameters for sorting the result, for searching on the marketplace in a specific language, for returning search facets, for conducting a spellcheck in case of typos in the search query or for paging through the search result. A sample query using all possible parameters and thus the full search interface would look like that:

httphttps://api.spreadshirt.net/api/v1/shops/205909/designs?query=herz mit pfeil&showFacets=true&spellcheck=true&sortField=price&sortOrder=desc&locale=de_DE&offset=10&limit=10&fullData=true

The meaning of the query parameters is as follows:

...

The possible values for the userIds and categoryIds field can be retrieved from the returned facet data (see search result payload below).

...

Understanding the search interface, we now want to have a look at the returned search result. An example of such a search result is displayed below:

Code Block

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<designs xmlns:xlink="http://www.w3.org/1999/xlink"
   xmlns="http://api.spreadshirt.net"
   query="herz mit pfeil"
   sortOrder="default"
   sortField="default"
   count="2209"
   limit="50"
   offset="0"
   xlink:href="httphttps://api.spreadshirt.net/api/v1/shops/205909/designs">
      <facets>
         ...
      </facets>
      <design xlink:href="httphttps://api.spreadshirt.net/api/v1/shops/205909/designs/m7195616-1"
              id="m7195616-1">
         <name>Herzen und Sterne</name>
         <price>
            <vatExcluded>2.52</vatExcluded>
            <vatIncluded>3.00</vatIncluded>
            <vat>19.00</vat>
            <currency xlink:href="httphttps://api.spreadshirt.net/api/v1/currencies/1" id="1"/>
         </price>
         <resources>
            <resource xlink:href="httphttps://image.spreadshirtspreadshirtmedia.net/image-server/v1/designs/7195616"
                      type="preview" mediaType="png"/>
         </resources>
      </design>
      ...

...