POST /v1/data/pinterest/posts/run
Pricing: $0.0035 per post ($3.50 per 1,000).
Ways to call it
- Search Query: set
query(optional:maxResults) - URLs: set
urls(optional:maxResults)
Request
Send the inputs underparams. Only the keys below are accepted; any other key returns 422 invalid_params.
Example
curl -X POST "https://api.mindcase.co/v1/data/pinterest/posts/run?wait=true" \
-H "Authorization: Bearer $MINDCASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"params": {
"query": "chocolate chip cookies",
"maxResults": 10
}
}'
import os, requests
r = requests.post(
"https://api.mindcase.co/v1/data/pinterest/posts/run",
params={"wait": "true"},
headers={"Authorization": f"Bearer {os.environ['MINDCASE_API_KEY']}"},
json={"params": {
"query": "chocolate chip cookies",
"maxResults": 10
}},
)
job = r.json()
rows = job.get("data", []) # if job["status"] == "running", poll /v1/jobs/{job_id}/results
const r = await fetch("https://api.mindcase.co/v1/data/pinterest/posts/run?wait=true", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.MINDCASE_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ params: {
"query": "chocolate chip cookies",
"maxResults": 10
} }),
});
const job = await r.json();
const rows = job.data ?? []; // if job.status === "running", poll /v1/jobs/{job_id}/results
Response fields
Each row indata is one post, keyed by these fields.
| Field | Name | Type |
|---|---|---|
pinUrl | Pin URL | url |
pinId | Pin ID | text |
title | Title | text |
description | Description | text |
altText | Alt Text | text |
image | Image | image |
imageWidth | Image Width | number |
imageHeight | Image Height | number |
isVideo | Is Video | boolean |
link | Link | url |
domain | Domain | text |
engagement | Engagement | number |
comments | Comments | number |
created | Created | datetime |
pinner | Pinner | object |
board | Board | object |
hashtags | Hashtags | array |
sourceType | Source Type | text |
Example response
Abridged: long text and lists are shortened.{
"job_id": "7f3a1c2e-0b9d-4c55-9a51-3f2e8d1b6a40",
"agent": "pinterest/posts",
"status": "completed",
"row_count": 1,
"truncated": false,
"data": [
{
"board": {
"id": "124834289610154400",
"name": "food!",
"url": "https://www.pinterest.com/jessicaleigh621/food/",
"pinCount": 449,
"imageUrl": "https://i.pinimg.com/200x150/57/23/ae/5723aebce11f0bbd6e5380de1105bdf0.jpg",
"owner": {
"id": "124834358329609203",
"username": "jessicaleigh621",
"fullName": "Jessica Mckay",
"followerCount": 75,
"profileUrl": "https://www.pinterest.com/jessicaleigh621/",
"imageUrl": "https://i.pinimg.com/75x75_RS/48/af/3d/48af3d785892fcc240916fba320e2f96.jpg",
"imageUrlLarge": "https://i.pinimg.com/140x140_RS/48/af/3d/48af3d785892fcc240916fba320e2f96.jpg"
}
},
"link": "https://www.handletheheat.com/bakery-style-chocolate-chip-cookies/",
"imageWidth": 572,
"pinUrl": "https://www.pinterest.com/pin/e1_AfqPShxglbdWCg5FeTWsx-DIAlFiT3VJtEZ8qNNxmGNNyBUzYmdq/",
"altText": "chocolate chip cookies are stacked on top of each other with the words bakery style chocolate chip cookies",
"domain": "handletheheat.com",
"description": "Ultra thick Bakery Style Chocolate Chip Cookies feature golden brown edges with soft and chewy centers. This easy homemade, from-scratch recipe can be made i...",
"isVideo": false,
"pinner": {
"id": "124834358329609203",
"username": "jessicaleigh621",
"fullName": "Jessica Mckay",
"followerCount": 75,
"profileUrl": "https://www.pinterest.com/jessicaleigh621/",
"imageUrl": "https://i.pinimg.com/75x75_RS/48/af/3d/48af3d785892fcc240916fba320e2f96.jpg",
"imageUrlLarge": "https://i.pinimg.com/140x140_RS/48/af/3d/48af3d785892fcc240916fba320e2f96.jpg"
},
"comments": 0,
"pinId": "e1_AfqPShxglbdWCg5FeTWsx-DIAlFiT3VJtEZ8qNNxmGNNyBUzYmdq",
"engagement": 520,
"imageHeight": 1200,
"created": "2020-03-25T23:29:09Z",
"title": null,
"hashtags": null,
"sourceType": "search",
"image": "https://i.pinimg.com/originals/66/9a/98/669a98326ff117a9e5d94919ab6d0a60.jpg"
}
]
}