Pinterest API

As of June 2012 Pinterest have not implemented their API, actually I'm not sure what's going on. There's a page here that talks about it.

I'm working on something where I need to access my pins and so have scraped Pinterest and am providing the results in the form of a 'Pinterest API'.

If it stops working do me a favour and email pinterestapi at jmoz dot co dot uk

Update 18/03/13

I've added paging support for all endpoints (I don't think boards works, not tested). For each request just add the querystring parameter page on the end:

Request

 $ curl http://pinterestapi.co.uk/jwmoz/pins?page=2

Pins: /{username}/pins

Returns an array of the specified user's pins. Limited to 50 results.

Example: http://pinterestapi.co.uk/jwmoz/pins from http://pinterest.com/jwmoz/pins/

Request

 $ curl http://pinterestapi.co.uk/jwmoz/pins

Response

{
"body": [
{
"href": "http://pinterest.com/pin/82190761920147628/",
"src": "http://media-cache-ec6.pinterest.com/upload/82190761920147628_1yqBmeG4_b.jpg",
"desc": "Haters gonna hate",
"board": "Internet shit",
"attrib": "roflmaocopter.com"
},
{
"href": "http://pinterest.com/pin/82190761920117535/",
"src": "http://media-cache-ec6.pinterest.com/upload/82190761920117535_eUUywlw1_b.jpg",
"desc": "Pho bo tai by jwm0z, via Flickr",
"board": "I'm hungry",
"attrib": "shoreditchvietnamese.co.uk"
}
],
"meta": {
"count": 2
}
}

Likes: /{username}/likes

Returns an array of the specified user's likes. Limited to 50 results.

Example: http://pinterestapi.co.uk/jwmoz/likes from http://pinterest.com/jwmoz/pins/?filter=likes

Request

 $ curl http://pinterestapi.co.uk/jwmoz/likes

Response

{
"body": [
{
"href": "http://pinterest.com/pin/150026231307331200/",
"src": "http://media-cache-ec3.pinterest.com/upload/228979962274567868_qVshovBS_b.jpg",
"desc": "#london",
"user": "Louise Earl",
"via": "Kris Mitchell",
"board": "Ideal"
},
{
"href": "http://pinterest.com/pin/287104544965407998/",
"src": "http://media-cache-ec8.pinterest.com/upload/287104544965407998_z3kbynbX_b.jpg",
"desc": "hipsters vs old people",
"user": "Lucy Foulkes",
"via": false,
"board": "cool"
}
],
"meta": {
"count": 2
}
}

"via" will be false for newly created pins e.g. "James Morris onto my board".

Boards: /{username}/boards

Returns an array of the specified user's boards.

Example: http://pinterestapi.co.uk/jwmoz/boards from http://pinterest.com/jwmoz/

Request

 $ curl http://pinterestapi.co.uk/jwmoz/boards

Response

{
"body": [
{
"name": "JMOZ",
"href": "http://pinterest.com/jwmoz/jmoz/",
"num_of_pins": 15,
"cover_src": "http://media-cache-ec6.pinterest.com/upload/82190761920194573_aPAbDtHD_222.jpg",
"thumbs_src": [
"http://media-cache-ec3.pinterest.com/upload/82190761920194563_dQcOIHvQ_t.jpg",
"http://media-cache-ec0.pinterest.com/upload/82190761920194557_VSSI2uQB_t.jpg",
"http://media-cache-ec3.pinterest.com/upload/82190761920194550_eThASthz_t.jpg",
"http://media-cache-ec0.pinterest.com/upload/82190761920191510_R6g5o9O3_t.jpg"
]
},
{
"name": "Take me there",
"href": "http://pinterest.com/jwmoz/take-me-there/",
"num_of_pins": 12,
"cover_src": "http://media-cache-ec5.pinterest.com/upload/68719872334_HOBq2gTw_222.jpg",
"thumbs_src": [
"http://media-cache-ec0.pinterest.com/upload/111534528241076034_aNmYVjwl_t.jpg",
"http://media-cache-ec9.pinterest.com/upload/184718022186817879_n3ifU0BW_t.jpg",
"http://media-cache-ec2.pinterest.com/upload/38210296808634166_SMPh77ua_t.jpg",
"http://media-cache-ec6.pinterest.com/upload/192177109069841840_kPEJVb6e_t.jpg"
]
}
],
"meta": {
"count": 2
}
}

"num_of_pins" will be false for empty boards.

"cover_src" will be false for empty boards.

"thumbs_src" will be false for empty boards.