このエンドポイントが役立つこと
レスポンスは、利用可能な ピン のフィールドを、正規化された V2 形式またはプラットフォーム固有の V1 形式で提供します。
使用に適した場面
オブジェクトが既にわかっていて、製品でその現在の公開コンテキストが必要な場合に「ピン ID による詳細」を使用します。
まず結果と一般的なワークフローを確認し、次にパラメーターと動作するリクエスト例に進んでください。
レスポンスは、利用可能な ピン のフィールドを、正規化された V2 形式またはプラットフォーム固有の V1 形式で提供します。
オブジェクトが既にわかっていて、製品でその現在の公開コンテキストが必要な場合に「ピン ID による詳細」を使用します。
製品の既知のオブジェクトを Pinterest の公開フィールドで補完します。
後続の処理の前に、識別子と現在の公開コンテキストを確認します。
オブジェクトの詳細をレポート、評価、関連リクエストの入力として使用します。
どちらのバージョンも同じタスクを解決し、同じパラメーターを受け付けます。切り替えを使ってレスポンス構造を比較し、クライアントが想定するバージョンを選んでください。
このページでバージョンを切り替えると、同じドキュメント URL でレスポンス構造を比較できます。
認証、必須パラメーター、リクエストの形は V1 と V2 で同じです。実際には、エンドポイントのパスを組み立てるときとレスポンスを読み取るときにバージョンを選びます。
主な違いはレスポンスのエンベロープです。新しい連携では V2 を使用し、既存のクライアント契約との互換性が必要な場合にのみ V1 を残してください。
どちらのバージョンでも、同じ API キーのヘッダーと同じクエリパラメーターを使用します。このドキュメントでは、まず共通のパラメーターを示し、次に各バージョンのパスとコードスニペットを示します。
| パラメーター | 必須 | 型 | 例 | 説明 |
|---|---|---|---|---|
pin_id |
はい | str |
99360735500167749 |
Pinterest pin identifier. Example: 99360735500167749. |
エンドポイントの正確なパス、URL の例、コードスニペットをコピーするときにバージョンを選んでください。上のパラメーター一覧は変わりません。
GET /api/v2/pinterest.com/pins/details-by-pin-idcurl --request GET \
--url "https://www.scrapestorm.net/api/v2/pinterest.com/pins/details-by-pin-id" \
--header "X-API-Key: 00000000-0000-4000-8000-000000000000" \
--get --data-urlencode 'pin_id=99360735500167749'
from urllib.parse import urljoin
import requests
BASE_URL = "https://www.scrapestorm.net"
ENDPOINT = "/api/v2/pinterest.com/pins/details-by-pin-id"
HEADERS = {"Accept": "application/json", "X-API-Key": "00000000-0000-4000-8000-000000000000"}
params = {
"pin_id": "99360735500167749",
}
with requests.Session() as session:
response = session.request(
method="GET",
url=urljoin(BASE_URL, ENDPOINT),
headers=HEADERS,
params=params,
timeout=30,
)
response.raise_for_status()
payload = response.json()
print(payload)
const BASE_URL = "https://www.scrapestorm.net";
const endpoint = "/api/v2/pinterest.com/pins/details-by-pin-id";
const params = new URLSearchParams({
pin_id: "99360735500167749",
});
const response = await fetch(`${BASE_URL}${endpoint}?${params.toString()}`, {
method: "GET",
headers: {
Accept: "application/json",
"X-API-Key": "00000000-0000-4000-8000-000000000000",
},
});
if (!response.ok) {
throw new Error(`Request failed: ${response.status} ${response.statusText}`);
}
const payload = await response.json();
console.log(payload);
import axios from "axios";
const client = axios.create({
baseURL: "https://www.scrapestorm.net",
timeout: 30000,
headers: {
Accept: "application/json",
"X-API-Key": "00000000-0000-4000-8000-000000000000",
},
});
const params = {
pin_id: "99360735500167749",
};
const { data: payload } = await client.request({
method: "GET",
url: endpoint,
params,
});
console.log(payload);
<?php
declare(strict_types=1);
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
$client = new Client([
'base_uri' => "https://www.scrapestorm.net",
'timeout' => 30.0,
'headers' => [
'Accept' => 'application/json',
'X-API-Key' => "00000000-0000-4000-8000-000000000000",
],
]);
$query = [
"pin_id" => "99360735500167749",
];
try {
$response = $client->request("GET", "/api/v2/pinterest.com/pins/details-by-pin-id", [
'query' => $query,
]);
$payload = json_decode(
(string) $response->getBody(),
true,
512,
JSON_THROW_ON_ERROR
);
var_dump($payload);
} catch (GuzzleException $e) {
throw $e;
}
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
"time"
)
func main() {
baseURL := "https://www.scrapestorm.net"
endpoint := "/api/v2/pinterest.com/pins/details-by-pin-id"
params := url.Values{}
params.Set("pin_id", "99360735500167749")
req, err := http.NewRequest(
"GET",
fmt.Sprintf("%s%s?%s", baseURL, endpoint, params.Encode()),
nil,
)
if err != nil {
panic(err)
}
req.Header.Set("Accept", "application/json")
req.Header.Set("X-API-Key", "00000000-0000-4000-8000-000000000000")
client := &http.Client{Timeout: 30 * time.Second}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var payload any
if err := json.NewDecoder(resp.Body).Decode(&payload); err != nil {
panic(err)
}
fmt.Printf("%+v\n", payload)
}
エンドポイントの正確なパス、URL の例、コードスニペットをコピーするときにバージョンを選んでください。上のパラメーター一覧は変わりません。
GET /api/v1/pinterest.com/pins/details-by-pin-idcurl --request GET \
--url "https://www.scrapestorm.net/api/v1/pinterest.com/pins/details-by-pin-id" \
--header "X-API-Key: 00000000-0000-4000-8000-000000000000" \
--get --data-urlencode 'pin_id=99360735500167749'
from urllib.parse import urljoin
import requests
BASE_URL = "https://www.scrapestorm.net"
ENDPOINT = "/api/v1/pinterest.com/pins/details-by-pin-id"
HEADERS = {"Accept": "application/json", "X-API-Key": "00000000-0000-4000-8000-000000000000"}
params = {
"pin_id": "99360735500167749",
}
with requests.Session() as session:
response = session.request(
method="GET",
url=urljoin(BASE_URL, ENDPOINT),
headers=HEADERS,
params=params,
timeout=30,
)
response.raise_for_status()
payload = response.json()
print(payload)
const BASE_URL = "https://www.scrapestorm.net";
const endpoint = "/api/v1/pinterest.com/pins/details-by-pin-id";
const params = new URLSearchParams({
pin_id: "99360735500167749",
});
const response = await fetch(`${BASE_URL}${endpoint}?${params.toString()}`, {
method: "GET",
headers: {
Accept: "application/json",
"X-API-Key": "00000000-0000-4000-8000-000000000000",
},
});
if (!response.ok) {
throw new Error(`Request failed: ${response.status} ${response.statusText}`);
}
const payload = await response.json();
console.log(payload);
import axios from "axios";
const client = axios.create({
baseURL: "https://www.scrapestorm.net",
timeout: 30000,
headers: {
Accept: "application/json",
"X-API-Key": "00000000-0000-4000-8000-000000000000",
},
});
const params = {
pin_id: "99360735500167749",
};
const { data: payload } = await client.request({
method: "GET",
url: endpoint,
params,
});
console.log(payload);
<?php
declare(strict_types=1);
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
$client = new Client([
'base_uri' => "https://www.scrapestorm.net",
'timeout' => 30.0,
'headers' => [
'Accept' => 'application/json',
'X-API-Key' => "00000000-0000-4000-8000-000000000000",
],
]);
$query = [
"pin_id" => "99360735500167749",
];
try {
$response = $client->request("GET", "/api/v1/pinterest.com/pins/details-by-pin-id", [
'query' => $query,
]);
$payload = json_decode(
(string) $response->getBody(),
true,
512,
JSON_THROW_ON_ERROR
);
var_dump($payload);
} catch (GuzzleException $e) {
throw $e;
}
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
"time"
)
func main() {
baseURL := "https://www.scrapestorm.net"
endpoint := "/api/v1/pinterest.com/pins/details-by-pin-id"
params := url.Values{}
params.Set("pin_id", "99360735500167749")
req, err := http.NewRequest(
"GET",
fmt.Sprintf("%s%s?%s", baseURL, endpoint, params.Encode()),
nil,
)
if err != nil {
panic(err)
}
req.Header.Set("Accept", "application/json")
req.Header.Set("X-API-Key", "00000000-0000-4000-8000-000000000000")
client := &http.Client{Timeout: 30 * time.Second}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var payload any
if err := json.NewDecoder(resp.Body).Decode(&payload); err != nil {
panic(err)
}
fmt.Printf("%+v\n", payload)
}
プレビューには主要なフィールドとコレクションの最初の要素が含まれているため、レスポンスの形をすばやく確認できます。バージョンを切り替えると JSON の形式が変わります。
このコンパクトな JSON の例は、V2 の直近の成功した検証実行から取得したものです。
{
"success": true,
"status": "ok",
"search_context": {
"pin_id": "99360735500167749"
},
"data": {
"pin": {
"url": "https://www.pinterest.com/pin/99360735500167749/",
"pin_id": "99360735500167749",
"aggregated_pin_id": "4793404135709870511",
"title": "Next stop: Pinterest!",
"description": "Today was my last day at Lexity. Next up? A little start-up in Palo Alto.",
"emails": [],
"hashtags": [],
"comment_count": 30,
"thumbnail_url": null,
"images": []
}
}
}
このコンパクトな JSON の例は、V1 の直近の成功した検証実行から取得したものです。
{
"success": true,
"status": "ok",
"search_context": {
"pin_id": "99360735500167749"
},
"data": {
"page_title": "Goodbye Live Tweeting, Hello Live Pinning | Website sharing button ideas, Pinterest button install, Share button ideas",
"app_version": "e86b6e0",
"current_url": "https://www.pinterest.com/pin/99360735500167749/",
"country": "US",
"country_from_ip": "US",
"locale": "en-US",
"is_authenticated": false,
"pws_data": {
"adsAPIDomain": "https://api.pinterest.com",
"appVersion": "e86b6e0",
"context": {
"analysis_ua": {
"app_type": 5,
"app_version": "",
"browser_name": "Chrome",
"browser_version": "145.0.0",
"device_type": null,
"device": "Other",
"os_name": "Windows 10",
"os_version": "10"
},
"app_type_detailed": 5,
"app_version": "e86b6e0",
"autologin": null,
"browser_locale": "en-US",
"browser_name": "Chrome",
"browser_type": 1,
"browser_version": "145.0.0",
"country": "US",
"country_from_hostname": "US",
"country_from_ip": "US",
"csp_nonce": "7a363e29880d0800607c26af6b0cdd10",
"current_url": "https://www.pinterest.com/pin/99360735500167749/",
"debug": false,
"deep_link": "",
"enabled_advertiser_countries": [
"AR",
"AT",
{
"_more_items": 24
}
],
"facebook_token": null,
"full_path": "/pin/99360735500167749/",
"http_referrer": "",
"impersonator_user_id": null,
"invite_code": "",
"invite_sender_id": "",
"is_authenticated": false,
"is_bot": "false",
"_more_fields": "33 more fields"
},
"enableAdaptiveStatsLoggingFlush": false,
"experiments": {
"active": {
"web_soft_navigation_origin_trial": "enabled"
},
"triggerable": {
"ace_shareable_ad_preview": "enabled",
"ace_shareable_ad_preview_routes": "enabled_ad_preview_metadata",
"ads_wpo_infra_hf": "enabled_wpo",
"ai_companion_full_page": "enabled",
"anticlimax_unauth_support": "enabled",
"ce_dweb_unauth_pin_card_overflow": "enabled",
"ce_dweb_unauth_related_pins_limit": "enabled",
"ce_dweb_unauth_signup_login_social_context": "enabled",
"ce_mweb_blp_blocking_upsell": "enabled",
"ce_mweb_unauth_related_pins_limit": "enabled",
"ce_mweb_unauth_related_pins_limit_parent": "ce_mweb_unauth_related_pins_limit",
"commerce_intergration_multisite": "enabled",
"commerce_intergration_nuvemshop_connect_page_upgrade": "enabled",
"concierge_cc_integration": "enabled_2",
"delivery_metrics_migration": "enabled",
"dweb_download_in_context_menus_v3": "enabled_download_click_sharesheet_ramp_allow_1",
"dweb_finetune_disable_autologin_behavior": "enabled_one_tap",
"dweb_google_button_visual_refresh": "enabled",
"dweb_rp_unauth_google_module": "enabled",
"dweb_search_unauth_google_module": "enabled",
"dweb_unauth_cookie_consent": "dweb_unauth_cookie_consent_modal",
"dweb_unauth_cookie_consent_modal": "enabled",
"dweb_unauth_dynamic_search_placeholder": "enabled_vase_loop_rollout",
"dweb_unauth_homepage_redesign": "enabled",
"_more_fields": "118 more fields"
}
},
"initialHandlerId": "www/pin/[id].js",
"isPrefetch": false,
"renderMode": "shellReady",
"site": "www",
"routeTree": [
{
"id": "www/_root",
"path": "/",
"children": [
{
"id": "www/ppr-app-shell.html",
"path": "ppr-app-shell.html",
"lazy": "…",
"handle": "…"
},
{
"id": "www/sw-shell.html",
"path": "sw-shell.html",
"lazy": "…",
"handle": "…"
},
{
"_more_items": 362
}
]
}
]
},
"pin_id": "99360735500167749",
"aggregated_pin_id": "4793404135709870511",
"comment_count": 30,
"grid_title": "Next stop: Pinterest!",
"description": "Today was my last day at Lexity. Next up? A little start-up in Palo Alto.",
"images": [],
"image_signature": "a76656e966b1958f568d63c3f1c05aec"
}
}
このドキュメントを最初の判断材料とし、継続的な利用のためにエンドポイントを接続する前に、料金、プラットフォームのカバー範囲、連携ルールを確認してください。
これらの回答を参考に、この API メソッドがワークフロー、バージョンの選択、導入計画に合うかどうかを判断してください。
このメソッドは ピン に対して「ピン ID による詳細」を実行します。以下のコンパクトなレスポンス例で、フィールドの正確な構造を確認できます。
新しい連携では、正規化された構造を提供する V2 を選んでください。V1 は、既にプラットフォーム固有の形式を処理しているクライアントとの互換性のためにのみ使用してください。
API キーを作成し、リクエストヘッダーで送信し、表の必須パラメーターを指定してください。コード例には、正しいパスとリクエスト構造が既に含まれています。