Skip to content

社交媒体 Pinterest 数据实时任务 ​

POST /v3/business_data/social_media/pinterest/live

接口说明 ​

POST /v3/business_data/social_media/pinterest/live

本接口用于获取指定网页在 Pinterest 上产生的保存次数。Pinterest 中的 Pin 对应网页保存行为,接口返回通过网页中 Pinterest Save Button 产生的保存数量。

每个任务最多可提交 10 个网页地址,并 targets 数组中的 URL 数量计费。每平台限流以认证说明中的 30/60/120 次/分钟规则为准。

所有请求体使用 UTF-8 编码的 JSON 格式,并以 JSON 数组提交。

计费说明 ​

本接口按请求中的目标 URL 数量计费。扣费以响应头 X-SeerMarTech-Charge-CNY 为准。

请求参数 ​

请求体结构 ​

json
[
  {
    "targets": [
      "https://www.example.com/page-a",
      "https://www.example.com/page-b"
    ],
    "tag": "pinterest_check_001"
  }
]

任务参数 ​

参数类型填说明
targetsarray是要查询的目标网页 URL 列表。使用绝对 URL,并 http:// 或 https://,例如 https://www.example.com/。最多可提交 10 个 URL,每个 URL 单独计费。
tagstring否用户自定义任务标识,用于请求与响应结果。最大长度为 255 个字符。提交后可在响应任务的 data 对象中获取。

响应结构 ​

接口返回 JSON 数据 tasks 任务数组。

顶层响应字段 ​

字段类型说明
versionstring当前 API 版本。
status_codeinteger通用响应状态码。详细状态码请参考错误码文档。
status_messagestring通用状态说明。
timestring请求执行耗时,单位为秒。
costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
tasks_countintegertasks 数组中的任务数量。
tasks_errorintegertasks 数组中返回错误的任务数量。
tasksarray任务结果数组。

tasks 任务字段 ​

字段类型说明
idstring平台生成的唯一任务标识,格式为 UUID。
status_codeinteger任务状态码,通常为 10000 至 60000。
status_messagestring任务状态说明。
timestring任务执行耗时,单位为秒。
costfloat平台原始 USD 成本兼容字段;人民币实扣以 X-SeerMarTech-Charge-CNY 为准。
result_countintegerresult 数组中的结果数量。
patharray请求 URL 路径信息。
dataobject当前任务对应的请求参数,提交时使用的字段。
resultarrayPinterest 数据结果数组。

result 结果字段 ​

字段类型说明
typestring结果类型,固定为 social_media_pinterest_item。
page_urlstring当前结果对应的网页 URL,即提交到 targets 数组中的 URL。
pins_countinteger该网页在 Pinterest 上的保存次数。

> pins_count 表示通过网页中的 Pinterest Save Button 产生的保存数量。

请求示例 ​

cURL ​

bash
curl --location --request POST \
  "https://api.seermartech.cn/v3/business_data/social_media/pinterest/live" \
  --header "Authorization: Bearer smt_live_YOUR_KEY" \
  --header "Content-Type: application/json" \
  --data-raw '[
    {
      "tag": "pinterest_check_001",
      "targets": [
        "https://www.simplyrecipes.com/recipes/grilled_salmon_with_cucumber_mango_salsa/",
        "https://tasty.co/recipe/classic-lasagna",
        "https://www.allrecipes.com/recipe/255263/sicilian-roasted-chicken/"
      ]
    }
  ]'

Python ​

python
import requests

url = "https://api.seermartech.cn/v3/business_data/social_media/pinterest/live"

headers = {
    "Authorization": "Bearer smt_live_YOUR_KEY",
    "Content-Type": "application/json",
}

payload = [
    {
        "tag": "pinterest_check_001",
        "targets": [
            "https://www.simplyrecipes.com/recipes/grilled_salmon_with_cucumber_mango_salsa/",
            "https://tasty.co/recipe/classic-lasagna",
            "https://www.allrecipes.com/recipe/255263/sicilian-roasted-chicken/",
        ],
    }
]

response = requests.post(url, headers=headers, json=payload)
result = response.json()

if result.get("status_code") == 20000:
    print(result)
else:
    print(
        "请求失败,状态码:{},信息:{}".format(
            result.get("status_code"),
            result.get("status_message"),
        )
    )

TypeScript ​

typescript
import axios from "axios";

const payload = [
  {
    tag: "pinterest_check_001",
    targets: [
      "https://www.simplyrecipes.com/recipes/grilled_salmon_with_cucumber_mango_salsa/",
      "https://tasty.co/recipe/classic-lasagna",
      "https://www.allrecipes.com/recipe/255263/sicilian-roasted-chicken/",
    ],
  },
];

axios
  .post(
    "https://api.seermartech.cn/v3/business_data/social_media/pinterest/live",
    payload,
    {
      headers: {
        Authorization: "Bearer smt_live_YOUR_KEY",
        "Content-Type": "application/json",
      },
    }
  )
  .then((response) => {
    console.log(response.data);
  })
  .catch((error) => {
    console.error("请求失败:", error.response?.data || error.message);
  });

PHP ​

php
<?php

$url = "https://api.seermartech.cn/v3/business_data/social_media/pinterest/live";

$payload = [
    [
        "tag" => "pinterest_check_001",
        "targets" => [
            "https://www.simplyrecipes.com/recipes/grilled_salmon_with_cucumber_mango_salsa/",
            "https://tasty.co/recipe/classic-lasagna",
            "https://www.allrecipes.com/recipe/255263/sicilian-roasted-chicken/"
        ]
    ]
];

$ch = curl_init($url);

curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer smt_live_YOUR_KEY",
        "Content-Type: application/json"
    ],
    CURLOPT_POSTFIELDS => json_encode($payload, JSON_UNESCAPED_SLASHES)
]);

$response = curl_exec($ch);
curl_close($ch);

$result = json_decode($response, true);

if (($result["status_code"] ?? null) === 20000) {
    print_r($result);
} else {
    echo "请求失败:";
    print_r($result);
}

C# ​

csharp
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;

public class PinterestDemo
{
    public static async Task Main()
    {
        using var httpClient = new HttpClient();

        httpClient.DefaultRequestHeaders.Authorization =
            new AuthenticationHeaderValue("Bearer", "smt_live_YOUR_KEY");

        var payload = new[]
        {
            new
            {
                tag = "pinterest_check_001",
                targets = new[]
                {
                    "https://www.simplyrecipes.com/recipes/grilled_salmon_with_cucumber_mango_salsa/",
                    "https://tasty.co/recipe/classic-lasagna",
                    "https://www.allrecipes.com/recipe/255263/sicilian-roasted-chicken/"
                }
            }
        };

        var json = JsonSerializer.Serialize(payload);
        using var content = new StringContent(
            json,
            Encoding.UTF8,
            "application/json"
        );

        var response = await httpClient.PostAsync(
            "https://api.seermartech.cn/v3/business_data/social_media/pinterest/live",
            content
        );

        var result = await response.Content.ReadAsStringAsync();
        Console.WriteLine(result);
    }
}

响应示例 ​

json
{
  "version": "0.1.20210721",
  "status_code": 20000,
  "status_message": "Ok.",
  "time": "0.6007 sec.",
  "cost": 0.00012,
  "tasks_count": 1,
  "tasks_error": 0,
  "tasks": [
    {
      "id": "01234567-89ab-cdef-0123-456789abcdef",
      "status_code": 20000,
      "status_message": "Ok.",
      "time": "0.5800 sec.",
      "cost": 0.00012,
      "result_count": 3,
      "path": [
        "v3",
        "business_data",
        "social_media",
        "pinterest",
        "live"
      ],
      "data": {
        "api": "business_data",
        "function": "pinterest",
        "targets": [
          "https://www.simplyrecipes.com/recipes/grilled_salmon_with_cucumber_mango_salsa/",
          "https://tasty.co/recipe/classic-lasagna",
          "https://www.allrecipes.com/recipe/255263/sicilian-roasted-chicken/"
        ],
        "tag": "pinterest_check_001"
      },
      "result": [
        {
          "type": "social_media_pinterest_item",
          "page_url": "https://www.simplyrecipes.com/recipes/grilled_salmon_with_cucumber_mango_salsa/",
          "pins_count": 128
        },
        {
          "type": "social_media_pinterest_item",
          "page_url": "https://tasty.co/recipe/classic-lasagna",
          "pins_count": 96
        },
        {
          "type": "social_media_pinterest_item",
          "page_url": "https://www.allrecipes.com/recipe/255263/sicilian-roasted-chicken/",
          "pins_count": 74
        }
      ]
    }
  ]
}

错误处理 ​

请根据顶层 status_code、任务级 status_code 及对应的 status_message 判断请求或任务是否成功。成功响应通常使用状态码 20000。异常,应记录任务 id、状态码和错误信息,并建立重试或人工处理机制。

实用场景 ​

  • 比较竞品页面的 Pinterest保存量,识别更容易获得社交传播的主题和页面类型。
  • 评估营销页面的社交表现,用 pins_count 衡量文章、食谱或产品页面的长期传播价值。
  • 筛选高传播潜力的 SEO,将 Pinterest 保存次数与自然搜索排名、流量等指标结合,优化选题。
  • 监控批量落地页的社交互动变化,定期提交多个页面并对比保存次数趋势,发现表现异常。
  • 支持资产优级排序,根据页面的 Pinterest 保存量确定更新、推广或二次分发的优顺序。

统一入口:官网 · LLM API · 控制台