Pinterest API Integration on Ayrshare

You’ve been asking for it and now it is finally here…our Pinterest API integration is available on Ayrshare.

Pinterest’s User Based is Growing…mostly

Pinterest is one of the premier social media networks, with 454 million active monthly users. It has seen continuous growth, well, except for Q2 2021 that became a slight misstep. Pinterest has a focus on sharing images that can be pinned (grouped) to “Pinterest Boards”. The demographics skew towards woman; in January 2021 77.1% of Pinterest users were female, 14.5% male, and 8.4% unspecified.

Just take a look at Pinterest’s growth:

Pinterest Monthly Active Users
Source https://www.statista.com/

If you have pictures, sell products, have a hobby, or want more social media exposure, then it is a great place to share your content.

Pinterest API V5 for Developers

The Pinterest API has gone through many iterations, with the last API V5 released for developers in Beta. For almost 2 years, Pinterest was not accepting new applications, so this is a major milestone in them opening up access.

The latest version simplifies the API is version 5, with a key focus on creating pins on boards, introducing analytics, and Pinterest ads and marketing. The standard oAuth authorization is used to authenticate users.

Ayrshare Pinterest API Integration: Post a Pin

After going through the review and approval process, Ayrshare now has a direct integration with Pinterest. Our Social Media API makes it easy for your to post across social platforms, auto add hashtags, get analytics, and comments.

Pinterest API Post Request Example

In the following Javascript / Node.js example, we’ll show how to post to Pinterest. Before starting, be sure to create your free Ayrshare account and get an API Key and link your social media networks – a Pinterest Board. Please see our docs for examples in PHP, Python, C#, and Go.

const fetch = require("node-fetch");
const API_KEY = "API_KEY"; // replace with your API Key from app.ayrshare.com

fetch("https://app.ayrshare.com/api/post", {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        "Authorization": `Bearer ${API_KEY}`
      },
      body: JSON.stringify({
        post: "The best Pinterest API ever!",
        platforms: ["pinterest"],
        mediaUrls: ["https://images.ayrshare.com/imgs/GhostBusters.jpg"],
        pinterestOptions: {
           title: "A Pinterest Board for You",
           link: "https://www.ayrshare.com"
        }
      }),
    })
      .then((res) => res.json())
      .then((json) => console.log(json))
      .catch(console.error);

The POST body has the following Javascript JSON parameters:

  • post: Description in the Pin.
  • platforms: Social platform to send, “pinterest”.
  • mediaUrls: URL of the image to post to Pinterest.
  • pinterstOptions: Additional optional parameters of the Pin title and the Pin’s link to your website or product.

Pinterest API Response Example

After posting to the https://app.ayrshare/api/post endpoint, you’ll receive back a status response JSON formatted with details of the success or failure. Here is an example of a 200 http return code success:

{
    "status": "success",
    "errors": [],
    "postIds": [
        {
            "status": "success",
            "id": "1288899996423983105",
            "platform": "pinterest",
            "postUrl": "https://www.pinterest.com/pin/718464946811465309/"
        }
    ],
    "id": "RhrbDtYh7hdSMc67zC8H"
}

Included in the response is the Pin URL as postUrl.

Pinterest User Analytics

You can also get analytics on the overall engagement. The data is at the user level and not for an individual Pin.

User Analytics Request

Similiar to the Post, you’ll call the API endpoint with the platforms “pinterest”.

const fetch = require("node-fetch");
const API_KEY = "API_KEY";

fetch("https://app.ayrshare.com/api/analytics/social", {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        "Authorization": `Bearer ${API_KEY}`
      },
      body: JSON.stringify({
        platforms: ["pinterest"]
      }),
    })
      .then((res) => res.json())
      .then((json) => console.log(json))
      .catch(console.error);

User Analytics Response

The response will contain the following data. The summary engagement history is the past 30 days, including daily engagement info.

{
    "pinterest": {
        "analytics": {    // 30 days summary and daily details
            "impression": 17,
            "engagement": 2,
            "engagementRate": 0.11764705882352941,
            "save": 1,
            "saveRate": 0.058823529411764705,
            "pinClick": 1,
            "pinClickRate": 0.058823529411764705,
            "outboundClick": 0,
            "outboundClickRate": 0,
            "daily": [
                {
                    "date": "2021-09-28",
                    "metrics": {
                        "IMPRESSION": 0,
                        "ENGAGEMENT": 0,
                        "ENGAGEMENT_RATE": 0,
                        "SAVE": 0,
                        "SAVE_RATE": 0,
                        "PIN_CLICK": 0,
                        "PIN_CLICK_RATE": 0,
                        "OUTBOUND_CLICK": 0,
                        "OUTBOUND_CLICK_RATE": 0
                    }
                },
                ...
            ]
        }
    },
    "status": "success"
}

The Future

We see this as just the beginning, and expect to see a V6 and V7 API with even more capabilities, which of course we’ll support. If you have any questions or ideas give us a 📣.