Close
0%
0%

Tindie Orders API in Python

Providing an open source API for Tindie

Public Chat
Similar projects worth following

Usage:

* Currently not a package, so ensure tindie​.​py from the github repo is in the same directory as your script or in your sys.path.

# I don't want tindie to be a name in my
# script because I want to name my tindie API variable tindie
from tindie import *

# setup
tindie = TindieOrdersAPI('<username>', '<API Key>')

# now we can get all of our orders.
# The JSON is already decoded into a Python dict.
json_data = tindie.get_orders_json()

# We can also filter in only unshipped orders by setting shipped to False
# Setting it to true would filter in only shipped orders!
json_data = tindie.get_orders_json(False)

Currently the API is very primitive, but it seems to work.

  • 1 × Tindie Store

  • A more useful and unique API

    Dylan Brophy08/28/2019 at 22:16 0 comments

    Before this API was basically just a wrapper for Python's Requests.  Not anymore.

    New features:

    • TindieOrder and TindieProduct objects to easily access data
    • get_orders function to return a list of TindieOrders
    • functions to get average shipping cost, revenue, and time between orders

    Also these functions will parse the strings into Python objects like datetime or timedelta.  Much more useful!

    ============ RESTART: /home/nuclaer/gitrepos/TindieAPI/tindie.py ============
    >>> api = TindieOrdersAPI('[Username]', '[API Key]')
    >>> orders = api.get_orders()
    >>> for i in orders:
    	print(i.seller_payout)
    
    [8 order prices]
    >>> api.average_order_shipping()
    5.6875
    >>> api.average_order_shipping(5)  # shipping over last 5 orders
    6.0
    >>> 

  • Now getting data about orders from Tindie!

    Dylan Brophy08/27/2019 at 22:44 0 comments

    This was pretty simple and easy.  Just used requests and a simple class to provide API access.

    You'll notice, however, it's not just a list of orders.  There's also this meta part, which has some miscellaneous that I didn't find docs on or uses for.

    In each order though, there is a ton of data.  Even data for features Tindie doesn't support yet - like preordering.  Interesting!!! I certainly hope they support that soon.

    Anyway, if you are interested in more I highly suggest playing with the API.  There doesn't seem to be much docs on this, but it certainly works.

View all 2 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates