Pinterest API

As of June 2012 Pinterest have not implemented their API.

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 06/08/13

Added /boards. Fixed 'board' attribute for /pins.

Update 17/07/13

More changes in Pinterest's backend has broken this app. Fixed pins and will work on others soon.

Update 15/07/13

I have updated the app to work with Pinterest's new backend. It now returns the same data as returned by Pinterest's own backend JSON service. This app is now acting pretty much as a proxy to their backend; no more scraping. A big thank you to @jacques404 who was helpful and provided information and code.

Update 02/07/13

Pinterest have changed how their site works so the scraper no longer works correctly. There is no planned fix at the moment, apologies.

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: "/pin/82190761922627506/",
            src: "http://media-cache-ec3.pinimg.com/236x/8f/89/c5/8f89c589227d78a9f2781eb1c2e79ee6.jpg",
            desc: "Iguazu Falls",
            board: {
                href: "/jwmoz/take-me-there/",
                name: "Take me there"
            },
            domain: "famouswonders.com",
            attrib: false
        },
        {
            href: "/pin/82190761920945513/",
            src: "http://media-cache-ak2.pinimg.com/236x/d5/43/85/d543854261c0323e813ef0f991d9089a.jpg",
            desc: "Samui lake by jwmoz, via Flickr",
            board: "Been & Seen Thailand",
            board: {
                href: "/jwmoz/been-seen-thailand/",
                name: "Been & Seen Thailand"
            },
            domain: "flickr.com",
            attrib: {
                attrib: "by jwmoz",
                href: "http://www.flickr.com/photos/jwmoz/",
                source: "Flickr",
                img: "http://passets-ak.pinterest.com/images/api/attrib/flickr.png"
            }
        }
    ],
    "meta": {
        "count": 2
    }
}

Boards: /{username}/boards

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

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

Request

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

Response

{
    "body": [
        {
            name: "JMOZ",
            href: "/jwmoz/jmoz/",
            src: "http://media-cache-ec0.pinimg.com/216x146/dc/ab/56/dcab566549e1d626110af92bf321f9dd.jpg"
        },
        {
            name: "Take me there",
            href: "/jwmoz/take-me-there/",
            src: "http://media-cache-ak0.pinimg.com/216x146/e2/d6/15/e2d615ac2ff7a43213d6c7a6bca2137c.jpg"
        },
    ],
    "meta": {
        "count": 2
    }
}