C. Papathanasiou 2015
I needed an API to obtain #bitcoin-otc trust scores returning the result in JSON. Such an API is not publicly accessible, so I decided to build one instead based on source code of the #bitcoin-otc Gribble bot:
https://github.com/nanotube/supybot-bitcoin-marketmonitor/blob/master/RatingSystem/plugin.py
The API server depends on:
Python Tornado
MySQLdb
sqlite3
Everything else should be pretty standard.
Requires access to a daily dump of the RatingSystem.db sqlite3 db which can be found here:
http://bitcoin-otc.com/otc/
I suggest you have a cronjob which dumps this nightly.
To start API server:
Christian-Papathanasious-iMac:Desktop chris$ python otc.py
To issue a request: HTTP POST to /gettrust with from_nick and to_nick parameters set to the two counterparties whose trust levels you wish to obtain.
Request
POST /gettrust HTTP/1.1
Host: localhost:8000
Content-Length: 34
Accept-Encoding: gzip, deflate
Accept: */*
User-Agent: python-requests/2.4.3 CPython/2.7.6 Darwin/14.0.0
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
to_nick=BigBitz&from_nick=nanotube
Response
HTTP/1.1 200 OK
Date: Mon, 26 Jan 2015 13:00:59 GMT
Content-Length: 108
Content-Type: text/html; charset=UTF-8
Server: TornadoServer/3.1.1
[{"result": "success", "from_nick": "nanotube", "to_nick": "BigBitz", "L1": 1, "L2": 34, "connections": 21}]