The API Tindie never told you about

Alain Pannetrat, December 08, 2023

Did you know that some of our awesome Lectronz sellers are also rocking a shop on Tindie? We're all about fostering a community of open-source hardware enthusiasts, and to make life easier for these sellers, we've crafted a nifty tool. It lets them effortlessly import their Tindie products into Lectronz with just a few clicks.

But wait, there's more! 🌟 We're thrilled to unveil an experimental feature that lets sellers view their Tindie products, check stock levels, and monitor order counts right from the Lectronz dashboard. No more hopping between platforms; it's all about simplifying your experience and promoting seamless interoperability. If you are a seller on Lectronz, go to your product list in your store dashboard to check it out!

Creating these new features took a deep dive into the Tindie API. We're so intrigued by our findings that we wanted to share the journey with you. There's a whole world of possibilities out there, and we're bringing it right to your fingertips. Ready to dive in with us?

The "official" order API GET /api/v1/order/

We assume your are familiar with the curl command. It's a powerful tool for making HTTP requests from the command line or a script. It supports various protocols, including HTTP, HTTPS, FTP, FTPS, SCP, SFTP, LDAP, and more. We'll use it in many examples.

If you are a Tindie seller, you have access to a JSON API that can be used to fetch your orders as described here. You need your username and API key to use that API, which is available in your store dashboard.

For example, as a seller, if your username is foobar and your API key is 0123456789abcdef0123456789abcdef, then the following curl query will return the latest 20 orders:

curl -H "Authorization: ApiKey foobar:0123456789abcdef0123456789abcdef" \
    "https://www.tindie.com/api/v1/order/"

The response, edited and truncated here for clarity, will look something like this:

{
   "meta" : {
      "limit" : 20,
      "next" : "/api/v1/order/?limit=20&offset=20",
      "offset" : 0,
      "previous" : null,
      "total_count" : 256
   },
   "orders" : [
      { 
         "company_title" : "",
         "date" : "2023-11-25T05:18:09.787002",
         ...

The meta object returned is useful. It tells us the total number of orders, as indicated by the total_count field (in our example, 256).

Additionally, since this response only contains the last 20 orders, we can follow the indications provided in the response in the next field to get the previous 20 orders using the limit and offset parameters:

curl -H "Authorization: ApiKey foobar:0123456789abcdef0123456789abcdef" \
    "https://www.tindie.com/api/v1/order/?limit=20&offset=20"

We can repeat this with different values of offset until we get all orders as needed. The API actually allows to retrieve up to 50 orders in one step by setting limit to 50.

It's worth mentioning that there is a variation of this API call that retrieves the list of unshipped orders, by simply passing shipped=false as a query parameter (i.e. GET /api/v1/order/?shipped=false).

Other API entry points?

While the above API is the most popular one, there are many other API entrypoints available for the curious hacker.

Getting all products available: GET /api/v1/product/

It is possible to get a list of all products available on Tindie, by simply querying the /api/v1/product/ entrypoint.

curl -H "Authorization: ApiKey foobar:0123456789abcdef0123456789abcdef" \
    "https://www.tindie.com/api/v1/product/"

The response, edited and truncated here for clarity, will look something like this:

{
   "meta" : {
      "limit" : 20,
      "next" : "/api/v1/product/?limit=20&offset=20",
      "offset" : 0,
      "previous" : null,
      "total_count" : 16296
   },
   "objects" : [
      {
         "amount_raised" : null,
         "category" : "beginner",
         "date_added" : "2012-11-18T05:33:08.269517",
         "end_date" : null,
         "id" : 324,
         "store_name" : "Part Fusion Electronics",
         "store_url" : "https://www.tindie.com/stores/partfusion/",
         "store_username" : "PartFusion",
         "title" : "I Can Solder Badge v1",
         "unit_price" : "2.50",
         "url" : "https://www.tindie.com/products/partfusion/i-can-solder-badge-v1/"
         ...

We learn that there are a total of 16296 products available on Tindie today! Besides that, the information provided is not very useful for a seller or even an end user.

Luckily, there's more interesting information elsewhere.

It turns out that there is another set of APIs, identified as the "V2" API.

More info on products available: GET /api/v2/products/

The first one we can explore allows us to get the list of all products available on Tindie with much more details by querying the /api/v2/products/ entrypoint.

curl -H "Authorization: ApiKey foobar:0123456789abcdef0123456789abcdef" \
    "https://www.tindie.com/api/v2/products/"

Note: To test these examples, use your own username and API Key.

By default, the API only returns 20 products at a time. Still, we can use the limit and offset parameters described for the "official" API to list all products by issuing multiple calls.

Each product entry provides access to almost all the information that exists about a product, including:

  • Current stock level,
  • Product options,
  • Product categories
  • Links to documentation,
  • Product images at various resolutions,
  • Reviews.

For each product listed, the response also provides the name and the identifier of the store that sells that product in a format similar to the following example:

         "store" : {
            "id" : "1234",
            "name" : "My super store",
            "resource_uri" : "/api/v2/stores/1234/"
         },

The store numerical id (here 1234) is a valuable piece of information that I will return to later.

An interesting feature of this API is that we can use it to get the stock available for any product sold on Tindie, a piece of information that is typically only available on the product page if the stock is low.

To get access to the details of some product information, further queries are sometimes needed. Let's look at some of these additional queries.

Get a single product: GET /api/v2/products/:id/

It's possible to get information about a single product with a GET query to /api/v2/products/:id/, replacing :id with the numerical identifier of the product.

Sellers can easily find the id of their products in their Tindie dashboard. For example, if the product id is 42, the following query will return a JSON description of product #42.

curl -H "Authorization: ApiKey foobar:0123456789abcdef0123456789abcdef" \
    "https://www.tindie.com/api/v2/products/42/"

Product options: GET /api/v2/products/:id/options/

A GET query to /api/v2/products/:id/options/, where :id is the unique numeric identifier of a Tindie product, returns details about the options associated with a product:

curl -H "Authorization: ApiKey foobar:0123456789abcdef0123456789abcdef" \
    "https://www.tindie.com/api/v2/products/42/options/"

Product images: GET /api/v2/products/:id/images/

A GET query to /api/v2/products/:id/images/, where :id is the unique numeric identifier of a Tindie product, returns details about the product images in various resolutions.

This API call follows the same pattern as for product options.

Product categories: GET /api/v2/categories/

A GET query to /api/v2/categories/ provides a list of all product categories available on Tindie. There are currently 66 product categories and we can use the offset and limit parameters to list them all.

Getting products of a specific store: GET /api/v2/products/?store={store_id}

Most sellers are not interested in getting information about all products available on Tindie, but would rather get information about the products available in their store.

This can be done by finding out the numerical identifier of a store and passing that value as a store query parameter to the GET /api/v2/products/ entry point. In other words, we issue the request GET /api/v2/products/?store={store_id} where {store_id} is replaced with the store numerical identifier.

Continuing our previous example, to get the list of products available from store 1234, we could issue the following request:

curl -H "Authorization: ApiKey foobar:0123456789abcdef0123456789abcdef" \
    "https://www.tindie.com/api/v2/products/?store=1234"

One question remains: how does a seller get his/her store identifier? Strangely, this information does not seem easy to obtain. One solution could be to download the list of all stores using the V2 store listing API described in the next section, and search for the one that matches the seller's store name or url. This is obviously cumbersome. As discussed later, the simplest solution is to get it from the product data returned by the GET /api/v2/products/ API endpoint.

More info on stores available GET /api/v2/stores/

The /api/v2/stores/ endpoint provides a list of all stores available on Tindie, with the following type of query:

curl -H "Authorization: ApiKey foobar:0123456789abcdef0123456789abcdef" \
    "https://www.tindie.com/api/v2/stores/"

This API call returns 50 store entries at a time, and we can use the offset and limit parameters to list them all as previously described.

The information provided for each store notably includes:

  • Total number of orders,
  • List of products,
  • Ratings and reviews,
  • The store numerical id.

It's possible to get information about a specific store by specifying a store identifier with a GET /api/v2/stores/:store_id query, replacing :store_id with the actual numerical id of a store.

Creating an API client for sellers

Store APIs are invaluable for sellers aiming to streamline their inventory and sales processes through a personalized interface or application. This becomes even more crucial for those juggling multiple platforms like Lectronz, Tindie, and Etsy, seeking a harmonized management system across the board.

As mentioned earlier, to tap into the potential of Tindie's APIs for your store, as a seller, you must first uncover your unique store_id — the numerical identifier that sets your Tindie store apart.

Here's the strategy we employ at Lectronz:

  1. Handpick a random product from the seller's Tindie store, identified by its numerical id.
  2. Dive into the product details using the GET /api/v2/products/:product_id/ endpoint, swapping :product_id with the actual numerical id from step 1.
  3. In the response to the product query, extract the numerical store id,

Now armed with the numerical store id, we can query the entire product list of that store using the GET /api/v2/products/?store={store_id} endpoint.

Conclusion

This article delved into the intriguing world of Tindie's API endpoints. It took us a bit on an adventure because while these endpoints are public, many remain shrouded in mystery, lacking proper documentation. You can explore and learn more by making GET queries directly to the /api/v1/ and /api/v2/ endpoints, which reveals some additional information, including JSON schema documentation.

A careful inspection of the API responses reveals fields hinting at features that no longer exist on Tindie, and some minor data elements are playing hide-and-seek. For instance, the JSON product description skips details about OSHWA certification status, raising questions about the API's development status. It seems like Tindie hit pause on these endpoints a few years back. Yet despite these minor gaps, the V2 API emerges as a powerful tool, especially for sellers eager to infuse automation into their store management.

Yes, API are cool! 🚀 They empower developers to forge innovative tools that add immense value to a platform.

Case in point: One Lectronz seller harnessed our API magic to birth 'lectronizer', a sleek desktop client designed to keep you in the loop with your orders on Lectronz.

Now, a friendly nudge to Tindie: How about some documentation love for your API? 😉📚

SHARE THIS ARTICLE
ABOUT ALAIN PANNETRAT
I'm on Lectronz.
Stay updated and grab the RSS feed