pinterest-api
Pinterest API v5 Development - Authentication, Pins, Boards, Analytics
What this skill does
# Pinterest API Skill
Comprehensive assistance with Pinterest API v5 development, including OAuth authentication, pin/board management, analytics, and API integration patterns.
## When to Use This Skill
This skill should be triggered when:
- Implementing Pinterest OAuth 2.0 authentication flows
- Creating, updating, or managing Pins and Boards via API
- Integrating Pinterest analytics and metrics into applications
- Building Pinterest API clients or SDKs
- Working with Pinterest user account data
- Debugging Pinterest API requests or responses
- Implementing Pinterest sharing features in web/mobile apps
- Setting up Pinterest business account integrations
- Working with Pinterest ad account APIs
## Key Concepts
### Pinterest API v5 Overview
- **Base URL**: `https://api.pinterest.com/v5/`
- **Authentication**: OAuth 2.0 with access tokens
- **Rate Limiting**: Token-based rate limits (varies by endpoint)
- **Response Format**: JSON
- **Required Headers**: `Authorization: Bearer {access_token}`
### Core Resources
- **Pins**: Individual pieces of content (images, videos) saved to Pinterest
- **Boards**: Collections that organize Pins by theme or topic
- **Sections**: Subsections within Boards for additional organization
- **User Account**: Pinterest user profile and account information
- **Ad Accounts**: Business accounts for advertising functionality
### Access Levels
- **Public Access**: Read-only access to public data
- **User Authorization**: Full access to user's Pins, Boards, and account
- **Business Access**: Additional analytics and ad account management (requires appropriate roles)
## Quick Reference
### OAuth 2.0 Authentication Flow
#### Step 1: Generate Authorization URL
```javascript
// Redirect user to Pinterest authorization page
const authUrl = `https://www.pinterest.com/oauth/?client_id={CLIENT_ID}&redirect_uri={REDIRECT_URI}&response_type=code&scope=boards:read,pins:read,user_accounts:read`;
window.location.href = authUrl;
```
#### Step 2: Exchange Code for Access Token
```bash
# After user authorizes, exchange authorization code for access token
curl -X POST https://api.pinterest.com/v5/oauth/token \
--header "Authorization: Basic {BASE64_ENCODED_CLIENT_CREDENTIALS}" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "grant_type=authorization_code" \
--data-urlencode "code={AUTHORIZATION_CODE}" \
--data-urlencode "redirect_uri={REDIRECT_URI}"
```
**Base64 Encoding Client Credentials:**
```bash
# Encode client_id:client_secret
echo -n "your_client_id:your_client_secret" | base64
```
**Response:**
```json
{
"access_token": "pina_ABC123...",
"token_type": "bearer",
"expires_in": 2592000,
"refresh_token": "DEF456...",
"scope": "boards:read,pins:read,user_accounts:read"
}
```
### Pin Management
#### Create a Pin
```bash
curl -X POST https://api.pinterest.com/v5/pins \
-H "Authorization: Bearer {ACCESS_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"link": "https://example.com/my-article",
"title": "My Amazing Pin Title",
"description": "Detailed description of the pin content",
"board_id": "123456789",
"media_source": {
"source_type": "image_url",
"url": "https://example.com/image.jpg"
}
}'
```
#### Get Pin Details
```bash
curl -X GET https://api.pinterest.com/v5/pins/{PIN_ID} \
-H "Authorization: Bearer {ACCESS_TOKEN}"
```
**Response:**
```json
{
"id": "987654321",
"created_at": "2025-01-15T10:30:00",
"link": "https://example.com/my-article",
"title": "My Amazing Pin Title",
"description": "Detailed description of the pin content",
"board_id": "123456789",
"media": {
"media_type": "image",
"images": {
"150x150": { "url": "...", "width": 150, "height": 150 },
"400x300": { "url": "...", "width": 400, "height": 300 },
"originals": { "url": "...", "width": 1200, "height": 800 }
}
}
}
```
#### Update a Pin
```bash
curl -X PATCH https://api.pinterest.com/v5/pins/{PIN_ID} \
-H "Authorization: Bearer {ACCESS_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"title": "Updated Pin Title",
"description": "Updated description",
"link": "https://example.com/updated-link"
}'
```
#### Delete a Pin
```bash
curl -X DELETE https://api.pinterest.com/v5/pins/{PIN_ID} \
-H "Authorization: Bearer {ACCESS_TOKEN}"
```
### Board Management
#### Create a Board
```bash
curl -X POST https://api.pinterest.com/v5/boards \
-H "Authorization: Bearer {ACCESS_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"name": "My New Board",
"description": "A collection of my favorite ideas",
"privacy": "PUBLIC"
}'
```
**Privacy Options:** `PUBLIC`, `PROTECTED`, `SECRET`
#### List User's Boards
```bash
curl -X GET https://api.pinterest.com/v5/boards \
-H "Authorization: Bearer {ACCESS_TOKEN}"
```
#### Get Board Pins
```bash
curl -X GET https://api.pinterest.com/v5/boards/{BOARD_ID}/pins \
-H "Authorization: Bearer {ACCESS_TOKEN}"
```
### User Account
#### Get Current User Account
```bash
curl -X GET https://api.pinterest.com/v5/user_account \
-H "Authorization: Bearer {ACCESS_TOKEN}"
```
**Response:**
```json
{
"account_type": "BUSINESS",
"id": "123456789",
"username": "myusername",
"website_url": "https://example.com",
"profile_image": "https://i.pinimg.com/...",
"follower_count": 1500,
"following_count": 320,
"board_count": 25,
"pin_count": 450
}
```
### Analytics
#### Get Pin Analytics
```bash
curl -X GET "https://api.pinterest.com/v5/pins/{PIN_ID}/analytics?start_date=2025-01-01&end_date=2025-01-31&metric_types=IMPRESSION,SAVE,PIN_CLICK" \
-H "Authorization: Bearer {ACCESS_TOKEN}"
```
**Available Metrics:**
- `IMPRESSION` - Number of times pin was shown
- `SAVE` - Number of times pin was saved
- `PIN_CLICK` - Number of clicks to pin destination
- `OUTBOUND_CLICK` - Clicks to external website
- `VIDEO_START` - Video plays started
**Response:**
```json
{
"all": {
"daily_metrics": [
{
"date": "2025-01-01",
"data_status": "READY",
"metrics": {
"IMPRESSION": 1250,
"SAVE": 45,
"PIN_CLICK": 89
}
}
]
}
}
```
### Error Handling
#### Common Error Response
```json
{
"code": 3,
"message": "Requested pin not found"
}
```
**Common Error Codes:**
- `1` - Invalid request parameters
- `2` - Rate limit exceeded
- `3` - Resource not found
- `4` - Insufficient permissions
- `8` - Invalid access token
#### Python Error Handling Example
```python
import requests
def create_pin(access_token, board_id, title, image_url):
url = "https://api.pinterest.com/v5/pins"
headers = {
"Authorization": f"Bearer {access_token}",
"Content-Type": "application/json"
}
data = {
"board_id": board_id,
"title": title,
"media_source": {
"source_type": "image_url",
"url": image_url
}
}
try:
response = requests.post(url, headers=headers, json=data)
response.raise_for_status()
return response.json()
except requests.exceptions.HTTPError as e:
error_data = e.response.json()
print(f"Error {error_data.get('code')}: {error_data.get('message')}")
return None
except requests.exceptions.RequestException as e:
print(f"Request failed: {str(e)}")
return None
```
### JavaScript/Node.js Integration
```javascript
// Pinterest API Client Example
class PinterestClient {
constructor(accessToken) {
this.accessToken = accessToken;
this.baseUrl = 'https://api.pinterest.com/v5';
}
async request(endpoint, options = {}) {
const url = `${this.baseUrl}${endpoint}`;
const headers = {
'Authorization': `Bearer ${this.accessToken}`,
'Content-Type': 'application/json',
...options.headers
};
const response = await fetch(url, {
...options,
headers
});
if (!response.ok) {
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.