PostRank Python API
What is PostRank?
PostRank is a scoring system developed by AideRSS to rank any kind of online content, such as RSS feed items, blog posts, articles, or news stories. PostRank is based on social engagement, which refers to how interesting or relevant people have found an item or category to be.
Public-facing RESTful API’s are becoming more popular as a way to allow access to services by third-parties. AideRSS recently decoupled their PostRank service and offered it as a stand-alone service allowing any developer to use PostRank within their application. I am in the process of updating this website/blog and I am planning to make use of the PostRank service not only as a tool to measure my engagement with the public, but increase the usefulness of my posts.
What is PostRank Python API and what does it do?
This is an api accessor for python that allows a developer to quickly access all of the services offered by PostRank. It is loosely modeled after Mike Verdone’s Python Twitter Tools in that it is simple to use, and it uses the same arguments as those documented on the PostRank API page.
What are the requirements?
- Python 2.5 (haven’t tested with <2.4)
- simplejson python library (if using json output)
How do I use it?
Using the PostRank Python API is very easy. The first step should be to look at the API documentation provided by the PostRank website.

We can see what options the api needs in order to satisfy the request. We just need to specify the resource that we want to use, then we can add all the arguments we want passed along to PostRank.

If you have selected JSON as your format, the api will return to you a simplejson object which can be accessed just like a multi-dimensional array. When using JSON, it is extremely simple to get at the information provided by PostRank.

There is a bit of a trick when using the ‘postrank‘ resource but it certainly isn’t difficult to use. It works the exact same way - the PostRank API says it wants an array of urls (url[]) so we will pass in an array of urls as an argument (same thing for the feed_id[]).

Following the same pattern as before, we just pass in the resource we want to use and the API arguments.

There really isn’t much more to it. For now, you can find the python library here: http://newthink.net/~ash/software/postrankapi/ When my new website is done, I plan to find a more permanent place for this (and future software). Next step, creating an egg and integrating with ez_install.
Sweet - Nice job!
We’ll make sure to get a link from PostRank.com back to this post so others can find it. Let us know if the url migrates with your new site - but we’ll be keeping our eye on this one!
Jim Murphy
Ash, that looks awesome. Looking forward to playing with this on the weekend.
[...] Thanks to Ash Christopher for the latest client library for the PostRank API in Python! [...]