CN ZH
登录

API

要开通我们的API访问权限,请通过Telegram联系我们的客服: @Spy_House

获取语言列表

请求URL

参数 数据类型 必填 描述
api_key 字符串 用于请求验证的唯一API密钥。
参数 数据类型 描述
status 字符串 表示请求执行成功("success")或错误("error")的字段。
msg 字符串 错误消息或额外的请求信息。
code 数字 响应代码,例如,成功请求为200。
data 数组 可用语言数组。
└ lang_id 数字 唯一语言标识符。
└ name 字符串 英文语言名称。
└ iso_code 字符串 ISO语言代码(例如,"EN"代表英语,"ZH"代表中文)。
<?php


    
function api_request($data = [])
    {
        
$ch curl_init('https://spy.house/api/filters/languages');

        
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
        
curl_setopt($chCURLOPT_CUSTOMREQUEST'POST');
        
curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE);
        
curl_setopt($chCURLOPT_IPRESOLVECURL_IPRESOLVE_V4);
        
curl_setopt($chCURLOPT_POSTFIELDShttp_build_query($data));

        
$body curl_exec($ch);
        
$info curl_getinfo($ch);

        
curl_close($ch);

        if ( ! empty(
$info['http_code']) && $info['http_code'] == 200) {
            return 
json_decode($bodyTRUE);
        }
    }


    
$body_request = ['api_key' => 'YOUR_API_KEY'];


    
$api_request api_request($body_request);
    if ( ! empty(
$api_request['status'])) {
        echo 
'<pre>';
        
print_r($api_request);
        echo 
'</pre>';
    }

获取国家列表

请求URL

参数 数据类型 必填 描述
api_key 字符串 用于请求验证的唯一API密钥。
参数 数据类型 描述
status 字符串 表示请求执行成功("success")或错误("error")的字段。
msg 字符串 错误消息或额外的请求信息。
code 数字 响应代码,例如,成功请求为200。
data 数组 可用国家数组。
└ country_id 数字 唯一国家标识符。
└ name 字符串 英文国家名称。
└ iso_code 字符串 ISO 3166-1 alpha-2国家代码(例如,"CN"代表中国)。
└ iso_code_3 字符串 ISO 3166-1 alpha-3国家代码(例如,"CHN"代表中国)。
<?php


    
function api_request($data = [])
    {
        
$ch curl_init('https://spy.house/api/filters/countries');

        
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
        
curl_setopt($chCURLOPT_CUSTOMREQUEST'POST');
        
curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE);
        
curl_setopt($chCURLOPT_IPRESOLVECURL_IPRESOLVE_V4);
        
curl_setopt($chCURLOPT_POSTFIELDShttp_build_query($data));

        
$body curl_exec($ch);
        
$info curl_getinfo($ch);

        
curl_close($ch);

        if ( ! empty(
$info['http_code']) && $info['http_code'] == 200) {
            return 
json_decode($bodyTRUE);
        }
    }


    
$body_request = ['api_key' => 'YOUR_API_KEY'];


    
$api_request api_request($body_request);
    if ( ! empty(
$api_request['status'])) {
        echo 
'<pre>';
        
print_r($api_request);
        echo 
'</pre>';
    }

获取浏览器列表

请求URL

参数 数据类型 必填 描述
api_key 字符串 用于请求验证的唯一API密钥。
参数 数据类型 描述
status 字符串 表示请求执行成功("success")或错误("error")的字段。
msg 字符串 错误消息或额外的请求信息。
code 数字 响应代码,例如,成功请求为200。
data 数组 可用浏览器数组。
└ browser_id 数字 唯一浏览器标识符。
└ name 字符串 浏览器名称。
<?php


    
function api_request($data = [])
    {
        
$ch curl_init('https://spy.house/api/filters/browsers');

        
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
        
curl_setopt($chCURLOPT_CUSTOMREQUEST'POST');
        
curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE);
        
curl_setopt($chCURLOPT_IPRESOLVECURL_IPRESOLVE_V4);
        
curl_setopt($chCURLOPT_POSTFIELDShttp_build_query($data));

        
$body curl_exec($ch);
        
$info curl_getinfo($ch);

        
curl_close($ch);

        if ( ! empty(
$info['http_code']) && $info['http_code'] == 200) {
            return 
json_decode($bodyTRUE);
        }
    }


    
$body_request = ['api_key' => 'YOUR_API_KEY'];


    
$api_request api_request($body_request);
    if ( ! empty(
$api_request['status'])) {
        echo 
'<pre>';
        
print_r($api_request);
        echo 
'</pre>';
    }

获取设备列表

请求URL

参数 数据类型 必填 描述
api_key 字符串 用于请求验证的唯一API密钥。
参数 数据类型 描述
status 字符串 表示请求执行成功("success")或错误("error")的字段。
msg 字符串 错误消息或额外的请求信息。
code 数字 响应代码,例如,成功请求为200。
data 数组 可用设备类型数组。
└ device_id 数字 唯一设备类型标识符。
└ name 字符串 设备类型显示名称。
└ value 字符串 API请求的设备类型值。
<?php


    
function api_request($data = [])
    {
        
$ch curl_init('https://spy.house/api/filters/devices');

        
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
        
curl_setopt($chCURLOPT_CUSTOMREQUEST'POST');
        
curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE);
        
curl_setopt($chCURLOPT_IPRESOLVECURL_IPRESOLVE_V4);
        
curl_setopt($chCURLOPT_POSTFIELDShttp_build_query($data));

        
$body curl_exec($ch);
        
$info curl_getinfo($ch);

        
curl_close($ch);

        if ( ! empty(
$info['http_code']) && $info['http_code'] == 200) {
            return 
json_decode($bodyTRUE);
        }
    }


    
$body_request = ['api_key' => 'YOUR_API_KEY'];


    
$api_request api_request($body_request);
    if ( ! empty(
$api_request['status'])) {
        echo 
'<pre>';
        
print_r($api_request);
        echo 
'</pre>';
    }

获取操作系统列表

请求URL

参数 数据类型 必填 描述
api_key 字符串 用于请求验证的唯一API密钥。
参数 数据类型 描述
status 字符串 表示请求执行成功("success")或错误("error")的字段。
msg 字符串 错误消息或额外的请求信息。
code 数字 响应代码,例如,成功请求为200。
data 数组 可用操作系统数组。
└ os_id 数字 唯一操作系统标识符。
└ name 字符串 操作系统显示名称。
└ value 字符串 API请求的操作系统值。
<?php


    
function api_request($data = [])
    {
        
$ch curl_init('https://spy.house/api/filters/operating_systems');

        
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
        
curl_setopt($chCURLOPT_CUSTOMREQUEST'POST');
        
curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE);
        
curl_setopt($chCURLOPT_IPRESOLVECURL_IPRESOLVE_V4);
        
curl_setopt($chCURLOPT_POSTFIELDShttp_build_query($data));

        
$body curl_exec($ch);
        
$info curl_getinfo($ch);

        
curl_close($ch);

        if ( ! empty(
$info['http_code']) && $info['http_code'] == 200) {
            return 
json_decode($bodyTRUE);
        }
    }


    
$body_request = ['api_key' => 'YOUR_API_KEY'];


    
$api_request api_request($body_request);
    if ( ! empty(
$api_request['status'])) {
        echo 
'<pre>';
        
print_r($api_request);
        echo 
'</pre>';
    }

获取广告网络列表

请求URL

参数 数据类型 必填 描述
api_key 字符串 用于请求验证的唯一API密钥。
参数 数据类型 描述
status 字符串 表示请求执行成功("success")或错误("error")的字段。
msg 字符串 错误消息或额外的请求信息。
code 数字 响应代码,例如,成功请求为200。
data 数组 可用广告网络数组。
└ network_id 数字 唯一广告网络标识符。
└ name 字符串 广告网络显示名称。
└ value 字符串 API请求的广告网络值。
└ logo 字符串 广告网络徽标URL。
<?php


    
function api_request($data = [])
    {
        
$ch curl_init('https://spy.house/api/filters/advertising_networks');

        
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
        
curl_setopt($chCURLOPT_CUSTOMREQUEST'POST');
        
curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE);
        
curl_setopt($chCURLOPT_IPRESOLVECURL_IPRESOLVE_V4);
        
curl_setopt($chCURLOPT_POSTFIELDShttp_build_query($data));

        
$body curl_exec($ch);
        
$info curl_getinfo($ch);

        
curl_close($ch);

        if ( ! empty(
$info['http_code']) && $info['http_code'] == 200) {
            return 
json_decode($bodyTRUE);
        }
    }


    
$body_request = ['api_key' => 'YOUR_API_KEY'];


    
$api_request api_request($body_request);
    if ( ! empty(
$api_request['status'])) {
        echo 
'<pre>';
        
print_r($api_request);
        echo 
'</pre>';
    }

搜索Push广告

使用多种过滤器搜索Push广告素材。

请求URL

参数 数据类型 必填 描述
api_key 字符串 用于请求验证的唯一API密钥。
limit 数字 每页项目数(10-100)。默认:10。
offset 数字 要跳过的项目数。用于分页。默认:0。
keyword 字符串 按标题或描述过滤广告素材的搜索关键词。
countries 数组 ISO-2国家代码数组(例如,["US", "GB", "DE"])。
country_ids 数组 来自/api/filters/countries端点的国家ID数组。优先于countries。
languages 数组 ISO语言代码数组(例如,["EN", "ZH", "DE"])。
lang_ids 数组 来自/api/filters/languages端点的语言ID数组。优先于languages。
advertising_networks 数组 广告网络名称数组。
network_ids 数组 来自/api/filters/advertising-networks端点的网络ID数组。优先于advertising_networks。
browsers 数组 浏览器名称数组。
browser_ids 数组 来自/api/filters/browsers端点的浏览器ID数组。优先于browsers。
operating_systems 数组 操作系统值数组(例如,["windows", "macos", "android"])。
devices 数组 设备类型数组(例如,["desktop", "mobile", "tablet"])。
date_from 字符串 过滤起始日期(格式:Y-m-d,例如,"2025-01-01")。
date_to 字符串 过滤结束日期(格式:Y-m-d,例如,"2025-12-31")。
sort_by 字符串 排序字段:creation、activity、popularity。
sort_order 字符串 排序方向:asc或desc。
only_adult Boolean 仅过滤成人内容。布尔值(true/false)。
参数 数据类型 描述
status 字符串 表示请求执行成功("success")或错误("error")的字段。
msg 字符串 错误消息或额外的请求信息。
code 数字 响应代码,例如,成功请求为200。
data Object 匹配请求的流程数据数组。
└ format 字符串 广告素材格式(push、inpage、facebook、tiktok)。
└ items 数组 广告素材对象数组。
  └ id 数字 唯一广告素材标识符。
  └ title 字符串 广告素材标题文本。
  └ description 字符串 广告素材描述文本。
  └ category 字符串 广告素材格式/类别(push、inpage、facebook、tiktok)。
  └ country Object 国家信息对象(code、name、iso_code_3)。
    └ code 字符串 ISO 3166-1 alpha-2国家代码(例如,"CN"代表中国)。
    └ name 字符串 英文国家名称。
    └ iso_code_3 字符串 ISO 3166-1 alpha-3国家代码(例如,"CHN"代表中国)。
  └ file_size 字符串 格式化的总文件大小。
  └ icon_url 字符串 广告素材图标图片URL。
  └ landing_url 字符串 着陆页URL。
  └ created_at 字符串 广告素材创建日期(Y-m-d格式)。
  └ advertising_networks 数组 广告网络名称数组。
  └ languages 数组 ISO语言代码数组。
  └ operating_systems 数组 操作系统值数组。
  └ browsers 数组 浏览器名称数组。
  └ devices 数组 设备类型数组。
  └ main_image_url 字符串 广告素材主图URL。
  └ is_adult Boolean 广告素材是否包含成人内容。
  └ is_active Boolean 广告素材当前是否活动。
└ pagination Object 分页信息对象。
  └ total 数字 匹配过滤器的广告素材总数。
  └ limit 数字 每页项目数。
  └ offset 数字 当前偏移量。
  └ has_more Boolean 是否还有更多可用项目。
  └ returned_count 数字 此响应中返回的项目数。
└ filters_applied Object 包含已应用过滤器的对象。
└ timestamp 字符串 ISO 8601格式的响应时间戳。
<?php

function searchPushCreatives($params = [])
{
    
$ch curl_init('https://spy.house/api/search/push');

    
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
    
curl_setopt($chCURLOPT_CUSTOMREQUEST'POST');
    
curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE);
    
curl_setopt($chCURLOPT_IPRESOLVECURL_IPRESOLVE_V4);
    
curl_setopt($chCURLOPT_POSTFIELDShttp_build_query($params));

    
$body curl_exec($ch);
    
$info curl_getinfo($ch);

    
curl_close($ch);

    if (!empty(
$info['http_code']) && $info['http_code'] == 200) {
        return 
json_decode($bodyTRUE);
    }
    return 
null;
}

// Example 1: Basic search with API key
$params = [
    
'api_key' => 'YOUR_API_KEY',
    
'limit' => 20,
    
'offset' => 0,
];

$result searchPushCreatives($params);

if (
$result && $result['status'] === 'success') {
    foreach (
$result['data']['items'] as $creative) {
        echo 
"ID: " $creative['id'] . " - " $creative['title'] . "\n";
    }
    echo 
"Total: " $result['data']['pagination']['total'] . "\n";
}

// Example 2: Search with ISO codes/names filters
$paramsWithFilters = [
    
'api_key' => 'YOUR_API_KEY',
    
'limit' => 50,
    
'offset' => 0,
    
'keyword' => 'casino',
    
'countries' => ['US''GB''DE'],  // ISO-2 codes
    
'languages' => ['EN'],                 // ISO codes
    
'browsers' => ['Chrome''Firefox'],    // Browser names
    
'sort_by' => 'creation',
    
'sort_order' => 'desc',
];

$filteredResult searchPushCreatives($paramsWithFilters);

// Example 3: Search with ID-based filters (recommended)
// Use IDs from /api/filters/* endpoints for better performance
$paramsWithIds = [
    
'api_key' => 'YOUR_API_KEY',
    
'limit' => 50,
    
'offset' => 0,
    
'keyword' => 'casino',
    
'country_ids' => [123],              // IDs from /api/filters/countries
    
'lang_ids' => [1],                      // IDs from /api/filters/languages
    
'network_ids' => [510],              // IDs from /api/filters/advertising-networks
    
'browser_ids' => [12],               // IDs from /api/filters/browsers
    
'sort_by' => 'creation',
    
'sort_order' => 'desc',
];

$resultWithIds searchPushCreatives($paramsWithIds);

// Note: ID-based filters take precedence over name-based filters
// If both country_ids and countries are provided, country_ids will be used

搜索Inpage广告

使用多种过滤器搜索Inpage广告素材。

请求URL

参数 数据类型 必填 描述
api_key 字符串 用于请求验证的唯一API密钥。
limit 数字 每页项目数(10-100)。默认:10。
offset 数字 要跳过的项目数。用于分页。默认:0。
keyword 字符串 按标题或描述过滤广告素材的搜索关键词。
countries 数组 ISO-2国家代码数组(例如,["US", "GB", "DE"])。
country_ids 数组 来自/api/filters/countries端点的国家ID数组。优先于countries。
languages 数组 ISO语言代码数组(例如,["EN", "ZH", "DE"])。
lang_ids 数组 来自/api/filters/languages端点的语言ID数组。优先于languages。
advertising_networks 数组 广告网络名称数组。
network_ids 数组 来自/api/filters/advertising-networks端点的网络ID数组。优先于advertising_networks。
browsers 数组 浏览器名称数组。
browser_ids 数组 来自/api/filters/browsers端点的浏览器ID数组。优先于browsers。
operating_systems 数组 操作系统值数组(例如,["windows", "macos", "android"])。
devices 数组 设备类型数组(例如,["desktop", "mobile", "tablet"])。
date_from 字符串 过滤起始日期(格式:Y-m-d,例如,"2025-01-01")。
date_to 字符串 过滤结束日期(格式:Y-m-d,例如,"2025-12-31")。
sort_by 字符串 排序字段:creation、activity、popularity。
sort_order 字符串 排序方向:asc或desc。
only_adult Boolean 仅过滤成人内容。布尔值(true/false)。
参数 数据类型 描述
status 字符串 表示请求执行成功("success")或错误("error")的字段。
msg 字符串 错误消息或额外的请求信息。
code 数字 响应代码,例如,成功请求为200。
data Object 匹配请求的流程数据数组。
└ format 字符串 广告素材格式(push、inpage、facebook、tiktok)。
└ items 数组 广告素材对象数组。
  └ id 数字 唯一广告素材标识符。
  └ title 字符串 广告素材标题文本。
  └ description 字符串 广告素材描述文本。
  └ category 字符串 广告素材格式/类别(push、inpage、facebook、tiktok)。
  └ country Object 国家信息对象(code、name、iso_code_3)。
    └ code 字符串 ISO 3166-1 alpha-2国家代码(例如,"CN"代表中国)。
    └ name 字符串 英文国家名称。
    └ iso_code_3 字符串 ISO 3166-1 alpha-3国家代码(例如,"CHN"代表中国)。
  └ file_size 字符串 格式化的总文件大小。
  └ icon_url 字符串 广告素材图标图片URL。
  └ landing_url 字符串 着陆页URL。
  └ created_at 字符串 广告素材创建日期(Y-m-d格式)。
  └ advertising_networks 数组 广告网络名称数组。
  └ languages 数组 ISO语言代码数组。
  └ operating_systems 数组 操作系统值数组。
  └ browsers 数组 浏览器名称数组。
  └ devices 数组 设备类型数组。
  └ main_image_url 字符串 广告素材主图URL。
  └ is_adult Boolean 广告素材是否包含成人内容。
  └ is_active Boolean 广告素材当前是否活动。
└ pagination Object 分页信息对象。
  └ total 数字 匹配过滤器的广告素材总数。
  └ limit 数字 每页项目数。
  └ offset 数字 当前偏移量。
  └ has_more Boolean 是否还有更多可用项目。
  └ returned_count 数字 此响应中返回的项目数。
└ filters_applied Object 包含已应用过滤器的对象。
└ timestamp 字符串 ISO 8601格式的响应时间戳。
<?php

function searchInpageCreatives($params = [])
{
    
$ch curl_init('https://spy.house/api/search/inpage');

    
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
    
curl_setopt($chCURLOPT_CUSTOMREQUEST'POST');
    
curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE);
    
curl_setopt($chCURLOPT_IPRESOLVECURL_IPRESOLVE_V4);
    
curl_setopt($chCURLOPT_POSTFIELDShttp_build_query($params));

    
$body curl_exec($ch);
    
$info curl_getinfo($ch);

    
curl_close($ch);

    if (!empty(
$info['http_code']) && $info['http_code'] == 200) {
        return 
json_decode($bodyTRUE);
    }
    return 
null;
}

// Example 1: Basic search with API key
$params = [
    
'api_key' => 'YOUR_API_KEY',
    
'limit' => 20,
    
'offset' => 0,
];

$result searchInpageCreatives($params);

if (
$result && $result['status'] === 'success') {
    foreach (
$result['data']['items'] as $creative) {
        echo 
"ID: " $creative['id'] . " - " $creative['title'] . "\n";
    }
    echo 
"Total: " $result['data']['pagination']['total'] . "\n";
}

// Example 2: Search with ISO codes/names filters
$paramsWithFilters = [
    
'api_key' => 'YOUR_API_KEY',
    
'limit' => 50,
    
'offset' => 0,
    
'keyword' => 'casino',
    
'countries' => ['US''GB''DE'],  // ISO-2 codes
    
'languages' => ['EN'],                 // ISO codes
    
'browsers' => ['Chrome''Firefox'],    // Browser names
    
'sort_by' => 'creation',
    
'sort_order' => 'desc',
];

$filteredResult searchInpageCreatives($paramsWithFilters);

// Example 3: Search with ID-based filters (recommended)
// Use IDs from /api/filters/* endpoints for better performance
$paramsWithIds = [
    
'api_key' => 'YOUR_API_KEY',
    
'limit' => 50,
    
'offset' => 0,
    
'keyword' => 'casino',
    
'country_ids' => [123],              // IDs from /api/filters/countries
    
'lang_ids' => [1],                      // IDs from /api/filters/languages
    
'network_ids' => [510],              // IDs from /api/filters/advertising-networks
    
'browser_ids' => [12],               // IDs from /api/filters/browsers
    
'sort_by' => 'creation',
    
'sort_order' => 'desc',
];

$resultWithIds searchInpageCreatives($paramsWithIds);

// Note: ID-based filters take precedence over name-based filters
// If both country_ids and countries are provided, country_ids will be used

搜索Facebook广告

使用多种过滤器搜索Facebook广告素材。当结果较少时,API可能会启动实时搜索并返回scrapingJob用于轮询。

如果scrapingJob.needStartPolling为true,请使用isPolling=true和job_id调用相同的端点以接收新项目。如果状态为recently_completed或rejected,则不会创建任务,不应开始轮询。

仅当countries数组中指定正好一个国家时才会启动实时搜索。

仅当提供非空关键词时才会启动实时搜索。

请求URL

参数 数据类型 必填 描述
api_key 字符串 用于请求验证的唯一API密钥。
limit 数字 每页项目数(10-100)。默认:10。
offset 数字 要跳过的项目数。用于分页。默认:0。
keyword 字符串 按标题或描述过滤广告素材的搜索关键词。
countries 数组 ISO-2国家代码数组(例如,["US", "GB", "DE"])。
country_ids 数组 来自/api/filters/countries端点的国家ID数组。优先于countries。
languages 数组 ISO语言代码数组(例如,["EN", "ZH", "DE"])。
lang_ids 数组 来自/api/filters/languages端点的语言ID数组。优先于languages。
date_from 字符串 过滤起始日期(格式:Y-m-d,例如,"2025-01-01")。
date_to 字符串 过滤结束日期(格式:Y-m-d,例如,"2025-12-31")。
sort_by 字符串 排序字段:creation、activity、popularity。
sort_order 字符串 排序方向:asc或desc。
status 字符串 广告状态过滤器:ALL、ACTIVE、INACTIVE。
media_type 字符串 媒体类型过滤器:ALL、IMAGE、VIDEO。
search_type 字符串 搜索类型:keyword_unordered、keyword_exact_phrase。
isPolling Boolean 启用实时搜索更新轮询。与job_id一起使用。
lastId 数字 用于增量轮询的最后接收的广告素材ID(可选)。
perPage 数字 用于检测低结果数的预期页面大小(12-96)。
job_id 字符串 来自scrapingJob的实时搜索任务ID。当isPolling=true时必需。
参数 数据类型 描述
status 字符串 表示请求执行成功("success")或错误("error")的字段。
msg 字符串 错误消息或额外的请求信息。
code 数字 响应代码,例如,成功请求为200。
data Object 匹配请求的流程数据数组。
└ format 字符串 广告素材格式(push、inpage、facebook、tiktok)。
└ items 数组 广告素材对象数组。
  └ id 数字 唯一广告素材标识符。
  └ title 字符串 广告素材标题文本。
  └ description 字符串 广告素材描述文本。
  └ category 字符串 广告素材格式/类别(push、inpage、facebook、tiktok)。
  └ country Object 国家信息对象(code、name、iso_code_3)。
    └ code 字符串 ISO 3166-1 alpha-2国家代码(例如,"CN"代表中国)。
    └ name 字符串 英文国家名称。
    └ iso_code_3 字符串 ISO 3166-1 alpha-3国家代码(例如,"CHN"代表中国)。
  └ file_size 字符串 格式化的总文件大小。
  └ icon_url 字符串 广告素材图标图片URL。
  └ landing_url 字符串 着陆页URL。
  └ created_at 字符串 广告素材创建日期(Y-m-d格式)。
  └ advertising_networks 数组 广告网络名称数组。
  └ languages 数组 ISO语言代码数组。
  └ operating_systems 数组 操作系统值数组。
  └ browsers 数组 浏览器名称数组。
  └ devices 数组 设备类型数组。
  └ main_image_url 字符串 广告素材主图URL。
  └ has_video Boolean 广告素材是否包含视频。
  └ video_url 字符串 视频URL(如果has_video为true)。
  └ video_duration 数字 视频时长(秒)(如适用)。
  └ social_likes 数字 点赞数(用于社交广告)。
  └ social_comments 数字 评论数(用于社交广告)。
  └ social_shares 数字 分享数(用于社交广告)。
  └ is_adult Boolean 广告素材是否包含成人内容。
  └ is_active Boolean 广告素材当前是否活动。
└ pagination Object 分页信息对象。
  └ total 数字 匹配过滤器的广告素材总数。
  └ limit 数字 每页项目数。
  └ offset 数字 当前偏移量。
  └ has_more Boolean 是否还有更多可用项目。
  └ returned_count 数字 此响应中返回的项目数。
└ filters_applied Object 包含已应用过滤器的对象。
└ scrapingJob Object 实时搜索任务对象(当实时搜索启动或活动时存在)。
  └ type 字符串 实时搜索类型标识符(例如,facebook_search)。
  └ status 字符串 任务状态:dispatched、running、post_processing、completed、failed、error、recently_completed、rejected。
  └ needStartPolling Boolean 客户端是否应开始轮询更新。
  └ needStopPolling Boolean 客户端是否应停止轮询。
  └ job_id 字符串 用于轮询的任务标识符(当状态为recently_completed或rejected时不存在)。
  └ polling_interval_seconds 数字 建议的轮询间隔(秒)。
  └ estimatedDuration 数字 预估持续时间(秒)(completed或recently_completed时为0)。
  └ message 字符串 来自服务器或解析器的额外状态消息。
  └ retry_after_seconds 数字 recently_completed/rejected时重试前等待时间(如果提供)。
  └ error 字符串 错误详情(当状态为failed或error时存在)。
└ timestamp 字符串 ISO 8601格式的响应时间戳。
<?php

function searchFacebookCreatives($params = [])
{
    
$ch curl_init('https://spy.house/api/search/facebook');

    
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
    
curl_setopt($chCURLOPT_CUSTOMREQUEST'POST');
    
curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE);
    
curl_setopt($chCURLOPT_IPRESOLVECURL_IPRESOLVE_V4);
    
curl_setopt($chCURLOPT_POSTFIELDShttp_build_query($params));

    
$body curl_exec($ch);
    
$info curl_getinfo($ch);

    
curl_close($ch);

    if (!empty(
$info['http_code']) && $info['http_code'] == 200) {
        return 
json_decode($bodyTRUE);
    }
    return 
null;
}

// Example 1: Basic search with API key
$params = [
    
'api_key' => 'YOUR_API_KEY',
    
'limit' => 20,
    
'offset' => 0,
    
'keyword' => 'casino',
    
'countries' => ['US'],
];

// Example 2: Social filters (status/media_type/search_type)
$paramsWithSocialFilters = [
    
'api_key' => 'YOUR_API_KEY',
    
'limit' => 20,
    
'offset' => 0,
    
'keyword' => 'casino',
    
'countries' => ['US'],
    
'status' => 'ACTIVE',
    
'media_type' => 'VIDEO',
    
'search_type' => 'keyword_unordered',
];

$result searchFacebookCreatives($paramsWithSocialFilters);

// Example 3: Live search polling (when scrapingJob.needStartPolling is true)
$initial searchFacebookCreatives([
    
'api_key' => 'YOUR_API_KEY',
    
'limit' => 10,
    
'offset' => 0,
    
'keyword' => 'casino',
    
'countries' => ['US'],
    
'status' => 'ACTIVE',
]);

if (
$initial && !empty($initial['data']['scrapingJob'])) {
    
$scrapingJob $initial['data']['scrapingJob'];

    if (!empty(
$scrapingJob['needStartPolling']) && !empty($scrapingJob['job_id'])) {
        
$pollingResult searchFacebookCreatives([
            
'api_key' => 'YOUR_API_KEY',
            
'isPolling' => true,
            
'job_id' => $scrapingJob['job_id'],
            
'limit' => 10,
            
'offset' => 0,
        ]);
    }
}

// Note: If scrapingJob.status is "recently_completed" or "rejected", 
// the job will not be created and polling should not be started.

搜索TikTok广告

使用多种过滤器搜索TikTok广告素材。当结果较少时,API可能会启动实时搜索并返回scrapingJob用于轮询。

如果scrapingJob.needStartPolling为true,请使用isPolling=true和job_id调用相同的端点以接收新项目。如果状态为recently_completed或rejected,则不会创建任务,不应开始轮询。

仅当countries数组中指定正好一个国家时才会启动实时搜索。

仅当提供非空关键词时才会启动实时搜索。

请求URL

参数 数据类型 必填 描述
api_key 字符串 用于请求验证的唯一API密钥。
limit 数字 每页项目数(10-100)。默认:10。
offset 数字 要跳过的项目数。用于分页。默认:0。
keyword 字符串 按标题或描述过滤广告素材的搜索关键词。
countries 数组 ISO-2国家代码数组(例如,["US", "GB", "DE"])。
country_ids 数组 来自/api/filters/countries端点的国家ID数组。优先于countries。
languages 数组 ISO语言代码数组(例如,["EN", "ZH", "DE"])。
lang_ids 数组 来自/api/filters/languages端点的语言ID数组。优先于languages。
date_from 字符串 过滤起始日期(格式:Y-m-d,例如,"2025-01-01")。
date_to 字符串 过滤结束日期(格式:Y-m-d,例如,"2025-12-31")。
sort_by 字符串 排序字段:creation、activity、popularity。
sort_order 字符串 排序方向:asc或desc。
video_duration 字符串 TikTok视频时长过滤器:ALL、SHORT、MEDIUM、LONG。
isPolling Boolean 启用实时搜索更新轮询。与job_id一起使用。
lastId 数字 用于增量轮询的最后接收的广告素材ID(可选)。
perPage 数字 用于检测低结果数的预期页面大小(12-96)。
job_id 字符串 来自scrapingJob的实时搜索任务ID。当isPolling=true时必需。
参数 数据类型 描述
status 字符串 表示请求执行成功("success")或错误("error")的字段。
msg 字符串 错误消息或额外的请求信息。
code 数字 响应代码,例如,成功请求为200。
data Object 匹配请求的流程数据数组。
└ format 字符串 广告素材格式(push、inpage、facebook、tiktok)。
└ items 数组 广告素材对象数组。
  └ id 数字 唯一广告素材标识符。
  └ title 字符串 广告素材标题文本。
  └ description 字符串 广告素材描述文本。
  └ category 字符串 广告素材格式/类别(push、inpage、facebook、tiktok)。
  └ country Object 国家信息对象(code、name、iso_code_3)。
    └ code 字符串 ISO 3166-1 alpha-2国家代码(例如,"CN"代表中国)。
    └ name 字符串 英文国家名称。
    └ iso_code_3 字符串 ISO 3166-1 alpha-3国家代码(例如,"CHN"代表中国)。
  └ file_size 字符串 格式化的总文件大小。
  └ icon_url 字符串 广告素材图标图片URL。
  └ landing_url 字符串 着陆页URL。
  └ created_at 字符串 广告素材创建日期(Y-m-d格式)。
  └ advertising_networks 数组 广告网络名称数组。
  └ languages 数组 ISO语言代码数组。
  └ operating_systems 数组 操作系统值数组。
  └ browsers 数组 浏览器名称数组。
  └ devices 数组 设备类型数组。
  └ main_image_url 字符串 广告素材主图URL。
  └ has_video Boolean 广告素材是否包含视频。
  └ video_url 字符串 视频URL(如果has_video为true)。
  └ video_duration 数字 视频时长(秒)(如适用)。
  └ social_likes 数字 点赞数(用于社交广告)。
  └ social_comments 数字 评论数(用于社交广告)。
  └ social_shares 数字 分享数(用于社交广告)。
  └ is_adult Boolean 广告素材是否包含成人内容。
  └ is_active Boolean 广告素材当前是否活动。
└ pagination Object 分页信息对象。
  └ total 数字 匹配过滤器的广告素材总数。
  └ limit 数字 每页项目数。
  └ offset 数字 当前偏移量。
  └ has_more Boolean 是否还有更多可用项目。
  └ returned_count 数字 此响应中返回的项目数。
└ filters_applied Object 包含已应用过滤器的对象。
└ scrapingJob Object 实时搜索任务对象(当实时搜索启动或活动时存在)。
  └ type 字符串 实时搜索类型标识符(例如,facebook_search)。
  └ status 字符串 任务状态:dispatched、running、post_processing、completed、failed、error、recently_completed、rejected。
  └ needStartPolling Boolean 客户端是否应开始轮询更新。
  └ needStopPolling Boolean 客户端是否应停止轮询。
  └ job_id 字符串 用于轮询的任务标识符(当状态为recently_completed或rejected时不存在)。
  └ polling_interval_seconds 数字 建议的轮询间隔(秒)。
  └ estimatedDuration 数字 预估持续时间(秒)(completed或recently_completed时为0)。
  └ message 字符串 来自服务器或解析器的额外状态消息。
  └ retry_after_seconds 数字 recently_completed/rejected时重试前等待时间(如果提供)。
  └ error 字符串 错误详情(当状态为failed或error时存在)。
└ timestamp 字符串 ISO 8601格式的响应时间戳。
<?php

function searchTikTokCreatives($params = [])
{
    
$ch curl_init('https://spy.house/api/search/tiktok');

    
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
    
curl_setopt($chCURLOPT_CUSTOMREQUEST'POST');
    
curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE);
    
curl_setopt($chCURLOPT_IPRESOLVECURL_IPRESOLVE_V4);
    
curl_setopt($chCURLOPT_POSTFIELDShttp_build_query($params));

    
$body curl_exec($ch);
    
$info curl_getinfo($ch);

    
curl_close($ch);

    if (!empty(
$info['http_code']) && $info['http_code'] == 200) {
        return 
json_decode($bodyTRUE);
    }
    return 
null;
}

// Example 1: Basic search with API key
$params = [
    
'api_key' => 'YOUR_API_KEY',
    
'limit' => 20,
    
'offset' => 0,
    
'keyword' => 'casino',
    
'countries' => ['US'],
];

// Example 2: TikTok filter (video_duration)
$paramsWithVideoDuration = [
    
'api_key' => 'YOUR_API_KEY',
    
'limit' => 20,
    
'offset' => 0,
    
'keyword' => 'casino',
    
'countries' => ['US'],
    
'video_duration' => 'SHORT',
];

$result searchTikTokCreatives($paramsWithVideoDuration);

// Example 3: Live search polling (when scrapingJob.needStartPolling is true)
$initial searchTikTokCreatives([
    
'api_key' => 'YOUR_API_KEY',
    
'limit' => 10,
    
'offset' => 0,
    
'keyword' => 'casino',
    
'countries' => ['US'],
]);

if (
$initial && !empty($initial['data']['scrapingJob'])) {
    
$scrapingJob $initial['data']['scrapingJob'];

    if (!empty(
$scrapingJob['needStartPolling']) && !empty($scrapingJob['job_id'])) {
        
$pollingResult searchTikTokCreatives([
            
'api_key' => 'YOUR_API_KEY',
            
'isPolling' => true,
            
'job_id' => $scrapingJob['job_id'],
            
'limit' => 10,
            
'offset' => 0,
        ]);
    }
}

// Note: If scrapingJob.status is "recently_completed" or "rejected", 
// the job will not be created and polling should not be started.

资金转账

请求URL

参数 数据类型 必填 描述
api_key 字符串 用于请求验证的唯一API密钥。
amount 数字 转账金额(最低10美元)。
email 字符串 收款人邮箱。必须有效。
参数 数据类型 描述
status 字符串 表示请求执行成功("success")或错误("error")的字段。
msg 字符串 错误消息或额外的请求信息。
code 数字 响应代码,例如,成功请求为200。
transaction_number 字符串 与转账关联的唯一交易号。
<?php


    
function api_request($data = [])
    {
        
$ch curl_init('https://spy.house/api/accounts/transfer_funds');

        
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
        
curl_setopt($chCURLOPT_CUSTOMREQUEST'POST');
        
curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE);
        
curl_setopt($chCURLOPT_IPRESOLVECURL_IPRESOLVE_V4);
        
curl_setopt($chCURLOPT_POSTFIELDShttp_build_query($data));

        
$body curl_exec($ch);
        
$info curl_getinfo($ch);

        
curl_close($ch);

        if ( ! empty(
$info['http_code']) && $info['http_code'] == 200) {
            return 
json_decode($bodyTRUE);
        }
    }


    
$body_request = [
        
'api_key' => 'YOUR_API_KEY',
        
'amount' => 100,
        
'email' => '[email protected]'
    ];


    
$api_request api_request($body_request);
    if ( ! empty(
$api_request['status'])) {
        echo 
'<pre>';
        
print_r($api_request);
        echo 
'</pre>';
    }

获取账户余额

请求URL

参数 数据类型 必填 描述
api_key 字符串 用于请求验证的唯一API密钥。
参数 数据类型 描述
status 字符串 表示请求执行成功("success")或错误("error")的字段。
msg 字符串 错误消息或额外的请求信息。
code 数字 响应代码,例如,成功请求为200。
balance 数字 用户当前账户余额。
<?php


    
function api_request($data = [])
    {
        
$ch curl_init('https://spy.house/api/accounts/balance');

        
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
        
curl_setopt($chCURLOPT_CUSTOMREQUEST'POST');
        
curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE);
        
curl_setopt($chCURLOPT_IPRESOLVECURL_IPRESOLVE_V4);
        
curl_setopt($chCURLOPT_POSTFIELDShttp_build_query($data));

        
$body curl_exec($ch);
        
$info curl_getinfo($ch);

        
curl_close($ch);

        if ( ! empty(
$info['http_code']) && $info['http_code'] == 200) {
            return 
json_decode($bodyTRUE);
        }
    }


    
$body_request = [
        
'api_key' => 'YOUR_API_KEY'
    ];


    
$api_request api_request($body_request);
    if ( ! empty(
$api_request['status'])) {
        echo 
'<pre>';
        
print_r($api_request);
        echo 
'</pre>';
    }

Retrieving a list of white pages

请求URL

参数 数据类型 必填 描述
api_key 字符串 用于请求验证的唯一API密钥。
search 字符串 String for searching by White Page name.
date_from 字符串 Start date for filtering (format: Y-m-d). (YYYY-MM-DD)
date_to 字符串 End date for filtering (format: Y-m-d). (YYYY-MM-DD)
limit 数字 Number of items per page (1 to 100). Default: 10.
page 数字 Page number, starting from 1. Default: 1.
参数 数据类型 描述
status 字符串 表示请求执行成功("success")或错误("error")的字段。
msg 字符串 错误消息或额外的请求信息。
code 数字 响应代码,例如,成功请求为200。
data.items 数组 Array of user's White Pages.
data.items[].id 数字 Unique identifier of the White Page.
data.items[].name 字符串 Name of the White Page.
data.items[].status 字符串 Status value: generating, pending, in_progress, completed, failed, error.
data.items[].status_label 字符串 Translated status description.
data.items[].generator_label 字符串 AI generator name.
data.items[].vertical_label 字符串 Selected niche/vertical name.
data.items[].language_label 字符串 Target language.
data.items[].theme_label 字符串 Selected template/theme name.
data.items[].amount 数字 Price charged for generation (e.g., 5.00) or null.
data.items[].can_retry Boolean Whether generation can be retried.
data.items[].can_download Boolean Whether the zip archive is ready to download.
data.items[].error_message 字符串 Localized error reason if generation failed.
data.items[].created_at 字符串 Creation date and time.
<?php

function get_white_pages($apiKey)
    {
        
$ch curl_init('https://spy.house/api/white-pages?api_key=' $apiKey);

        
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
        
curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE);
        
curl_setopt($chCURLOPT_IPRESOLVECURL_IPRESOLVE_V4);

        
$body curl_exec($ch);
        
curl_close($ch);

        return 
json_decode($bodyTRUE);
    }

    
$result get_white_pages('YOUR_API_KEY');
    
print_r($result);

Retrieving generator configuration options

请求URL

参数 数据类型 必填 描述
api_key 字符串 用于请求验证的唯一API密钥。
参数 数据类型 描述
status 字符串 表示请求执行成功("success")或错误("error")的字段。
msg 字符串 错误消息或额外的请求信息。
code 数字 响应代码,例如,成功请求为200。
data.generators 数组 List of available AI generators for id_generator param.
data.generators[].id 数字 Numeric ID of the option.
data.generators[].slug 字符串 Slug/value of the option.
data.generators[].label 字符串 Translated name of the option.
data.verticals 数组 List of available niche verticals for id_vertical param.
data.verticals[].id 数字 Numeric ID of the option.
data.verticals[].slug 字符串 Slug/value of the option.
data.verticals[].label 字符串 Translated name of the option.
data.languages 数组 List of target languages for id_language param.
data.languages[].id 数字 Numeric ID of the option.
data.languages[].slug 字符串 Slug/value of the option.
data.languages[].label 字符串 Translated name of the option.
data.themes Object Templates map grouped by id_generator key.
<?php

function get_generator_options($apiKey)
    {
        
$ch curl_init('https://spy.house/api/white-pages/options?api_key=' $apiKey);

        
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
        
curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE);
        
curl_setopt($chCURLOPT_IPRESOLVECURL_IPRESOLVE_V4);

        
$body curl_exec($chcurl_close($ch);

        return 
json_decode($bodyTRUE);
    }

    
$result get_generator_options('YOUR_API_KEY');
    
print_r($result);

Generating a white page

请求URL

参数 数据类型 必填 描述
api_key 字符串 用于请求验证的唯一API密钥。
name 字符串 Name of the White Page (for reference, max 64 chars).
id_generator 数字 Generator ID from options endpoint.
id_vertical 数字 Vertical ID from options endpoint.
id_language 数字 Language ID from options endpoint.
theme 字符串 Theme slug string corresponding to the selected generator.
wp_domain 字符串 Optional target domain name.
wp_company 字符串 Optional company name for copy/legal page sections.
wp_phone 字符串 Optional contact phone number.
wp_email 字符串 Optional contact email address.
wp_keywords 字符串 Optional comma-separated keywords to tailor site content.
参数 数据类型 描述
status 字符串 表示请求执行成功("success")或错误("error")的字段。
msg 字符串 错误消息或额外的请求信息。
code 数字 响应代码,例如,成功请求为200。
data.id 数字 Unique identifier of the White Page.
data.name 字符串 Name of the White Page.
data.status 字符串 Status value: generating, pending, in_progress, completed, failed, error.
data.status_label 字符串 Translated status description.
<?php

function generate_white_page($apiKey$params)
    {
        
$ch curl_init('https://spy.house/api/white-pages/generate?api_key=' $apiKey);

        
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
        
curl_setopt($chCURLOPT_POSTTRUE);
        
curl_setopt($chCURLOPT_POSTFIELDShttp_build_query($params));
        
curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE);
        
curl_setopt($chCURLOPT_IPRESOLVECURL_IPRESOLVE_V4);

        
$body curl_exec($ch);
        
curl_close($ch);

        return 
json_decode($bodyTRUE);
    }

    
$params = [
        
'name' => 'My First WhitePage',
        
'id_generator' => 1,
        
'id_vertical' => 2,
        
'id_language' => 1,
        
'theme' => 'travel'
    ];

    
$result generate_white_page('YOUR_API_KEY'$params);
    
print_r($result);

Retrieving generation status

请求URL

参数 数据类型 必填 描述
api_key 字符串 用于请求验证的唯一API密钥。
参数 数据类型 描述
status 字符串 表示请求执行成功("success")或错误("error")的字段。
msg 字符串 错误消息或额外的请求信息。
code 数字 响应代码,例如,成功请求为200。
data.id 数字 Unique identifier of the White Page.
data.status 字符串 Status value: generating, pending, in_progress, completed, failed, error.
data.status_label 字符串 Translated status description.
data.can_retry Boolean Whether generation can be retried.
data.can_download Boolean Whether the zip archive is ready to download.
data.error_message 字符串 Localized error reason if generation failed.
<?php

function get_white_page_status($apiKey$id)
    {
        
$ch curl_init('https://spy.house/api/white-pages/' $id '/status?api_key=' $apiKey);

        
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
        
curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE);
        
curl_setopt($chCURLOPT_IPRESOLVECURL_IPRESOLVE_V4);

        
$body curl_exec($ch);
        
curl_close($ch);

        return 
json_decode($bodyTRUE);
    }

    
$result get_white_page_status('YOUR_API_KEY'123);
    
print_r($result);

Retrieving download link

请求URL

参数 数据类型 必填 描述
api_key 字符串 用于请求验证的唯一API密钥。
参数 数据类型 描述
status 字符串 表示请求执行成功("success")或错误("error")的字段。
msg 字符串 错误消息或额外的请求信息。
code 数字 响应代码,例如,成功请求为200。
data.download_url 字符串 Temporary authenticated URL to download the zip file.
<?php

function get_white_page_download_url($apiKey$id)
    {
        
$ch curl_init('https://spy.house/api/white-pages/' $id '/download?api_key=' $apiKey);

        
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
        
curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE);
        
curl_setopt($chCURLOPT_IPRESOLVECURL_IPRESOLVE_V4);

        
$body curl_exec($ch);
        
curl_close($ch);

        return 
json_decode($bodyTRUE);
    }

    
$result get_white_page_download_url('YOUR_API_KEY'123);
    
print_r($result);

Downloading white page file

请求URL

参数 数据类型 必填 描述
api_key 字符串 用于请求验证的唯一API密钥。

Returns the zip archive payload as binary stream with `Content-Type: application/zip` and `Content-Disposition: attachment` headers.

<?php

function download_white_page_file($apiKey$id$saveToPath)
    {
        
$fp fopen($saveToPath'w+');
        
$ch curl_init('https://spy.house/api/white-pages/' $id '/file?api_key=' $apiKey);

        
curl_setopt($chCURLOPT_FILE$fp);
        
curl_setopt($chCURLOPT_TIMEOUT300);
        
curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE);
        
curl_setopt($chCURLOPT_IPRESOLVECURL_IPRESOLVE_V4);

        
curl_exec($chcurl_close($ch);
        
fclose($fp);
    }

    
download_white_page_file('YOUR_API_KEY'123'/path/to/save/archive.zip');

Deleting a white page

请求URL

参数 数据类型 必填 描述
api_key 字符串 用于请求验证的唯一API密钥。
参数 数据类型 描述
status 字符串 表示请求执行成功("success")或错误("error")的字段。
msg 字符串 错误消息或额外的请求信息。
code 数字 响应代码,例如,成功请求为200。
data.deleted Boolean True if deletion succeeded.
<?php

function delete_white_page($apiKey$id)
    {
        
$ch curl_init('https://spy.house/api/white-pages/' $id '?api_key=' $apiKey);

        
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
        
curl_setopt($chCURLOPT_CUSTOMREQUEST'DELETE');
        
curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE);
        
curl_setopt($chCURLOPT_IPRESOLVECURL_IPRESOLVE_V4);

        
$body curl_exec($ch);
        
curl_close($ch);

        return 
json_decode($bodyTRUE);
    }

    
$result delete_white_page('YOUR_API_KEY'123);
    
print_r($result);

Retrying failed generation

请求URL

参数 数据类型 必填 描述
api_key 字符串 用于请求验证的唯一API密钥。
参数 数据类型 描述
status 字符串 表示请求执行成功("success")或错误("error")的字段。
msg 字符串 错误消息或额外的请求信息。
code 数字 响应代码,例如,成功请求为200。
data.id 数字 Unique identifier of the White Page.
data.status 字符串 Status value: generating, pending, in_progress, completed, failed, error.
data.generating_label 字符串 Translated label for the new generating status.
<?php

function retry_white_page($apiKey$id)
    {
        
$ch curl_init('https://spy.house/api/white-pages/' $id '/retry?api_key=' $apiKey);

        
curl_setopt($chCURLOPT_RETURNTRANSFERTRUE);
        
curl_setopt($chCURLOPT_POSTTRUE);
        
curl_setopt($chCURLOPT_SSL_VERIFYPEERFALSE);
        
curl_setopt($chCURLOPT_IPRESOLVECURL_IPRESOLVE_V4);

        
$body curl_exec($ch);
        
curl_close($ch);

        return 
json_decode($bodyTRUE);
    }

    
$result retry_white_page('YOUR_API_KEY'123);
    
print_r($result);