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($ch, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
curl_setopt($ch, CURLOPT_POSTFIELDS, http_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($body, TRUE);
        }
    }


    
$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($ch, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
curl_setopt($ch, CURLOPT_POSTFIELDS, http_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($body, TRUE);
        }
    }


    
$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($ch, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
curl_setopt($ch, CURLOPT_POSTFIELDS, http_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($body, TRUE);
        }
    }


    
$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($ch, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
curl_setopt($ch, CURLOPT_POSTFIELDS, http_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($body, TRUE);
        }
    }


    
$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($ch, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
curl_setopt($ch, CURLOPT_POSTFIELDS, http_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($body, TRUE);
        }
    }


    
$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($ch, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
curl_setopt($ch, CURLOPT_POSTFIELDS, http_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($body, TRUE);
        }
    }


    
$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格式)。
  └ last_seen_at 字符串 / null 素材在来源中最后一次被观察到的日期(Y-m-d),未知时为 null。
  └ 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($ch, CURLOPT_RETURNTRANSFER, TRUE);
    
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
    
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
    
curl_setopt($ch, CURLOPT_POSTFIELDS, http_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($body, TRUE);
    }
    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' => [1, 2, 3],              // IDs from /api/filters/countries
    
'lang_ids' => [1],                      // IDs from /api/filters/languages
    
'network_ids' => [5, 10],              // IDs from /api/filters/advertising-networks
    
'browser_ids' => [1, 2],               // 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格式)。
  └ last_seen_at 字符串 / null 素材在来源中最后一次被观察到的日期(Y-m-d),未知时为 null。
  └ 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($ch, CURLOPT_RETURNTRANSFER, TRUE);
    
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
    
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
    
curl_setopt($ch, CURLOPT_POSTFIELDS, http_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($body, TRUE);
    }
    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' => [1, 2, 3],              // IDs from /api/filters/countries
    
'lang_ids' => [1],                      // IDs from /api/filters/languages
    
'network_ids' => [5, 10],              // IDs from /api/filters/advertising-networks
    
'browser_ids' => [1, 2],               // 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

搜索Native广告

使用多种过滤器搜索Native (MGID/Taboola) 广告素材。

请求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。
参数 数据类型 描述
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。
  └ main_image_url 字符串 广告素材主图URL。
  └ landing_url 字符串 着陆页URL。
  └ created_at 字符串 广告素材创建日期(Y-m-d格式)。
  └ last_seen_at 字符串 / null 素材在来源中最后一次被观察到的日期(Y-m-d),未知时为 null。
  └ advertising_networks 数组 广告网络名称数组。
  └ languages 数组 ISO语言代码数组。
  └ operating_systems 数组 操作系统值数组。
  └ browsers 数组 浏览器名称数组。
  └ devices 数组 设备类型数组。
  └ is_adult Boolean 广告素材是否包含成人内容。
  └ is_active Boolean 广告素材当前是否活动。
└ pagination Object 分页信息对象。
  └ total 数字 匹配过滤器的广告素材总数。
  └ limit 数字 每页项目数。
  └ offset 数字 当前偏移量。
  └ has_more Boolean 是否还有更多可用项目。
  └ returned_count 数字 此响应中返回的项目数。
└ filters_applied Object 包含已应用过滤器的对象。
└ timestamp 字符串 ISO 8601格式的响应时间戳。
<?php

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

    
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
    
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
    
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
    
curl_setopt($ch, CURLOPT_POSTFIELDS, http_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($body, TRUE);
    }
    return 
null;
}

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

$result = searchNativeCreatives($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 = searchNativeCreatives($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' => [1, 2, 3],              // IDs from /api/filters/countries
    
'lang_ids' => [1],                      // IDs from /api/filters/languages
    
'network_ids' => [5, 10],              // IDs from /api/filters/advertising-networks
    
'browser_ids' => [1, 2],               // IDs from /api/filters/browsers
    
'sort_by' => 'creation',
    
'sort_order' => 'desc',
];

$resultWithIds = searchNativeCreatives($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格式)。
  └ last_seen_at 字符串 / null 素材在来源中最后一次被观察到的日期(Y-m-d),未知时为 null。
  └ 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($ch, CURLOPT_RETURNTRANSFER, TRUE);
    
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
    
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
    
curl_setopt($ch, CURLOPT_POSTFIELDS, http_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($body, TRUE);
    }
    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格式)。
  └ last_seen_at 字符串 / null 素材在来源中最后一次被观察到的日期(Y-m-d),未知时为 null。
  └ 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($ch, CURLOPT_RETURNTRANSFER, TRUE);
    
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
    
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
    
curl_setopt($ch, CURLOPT_POSTFIELDS, http_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($body, TRUE);
    }
    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($ch, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
curl_setopt($ch, CURLOPT_POSTFIELDS, http_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($body, TRUE);
        }
    }


    
$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($ch, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
        
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
        
curl_setopt($ch, CURLOPT_POSTFIELDS, http_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($body, TRUE);
        }
    }


    
$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>';
    }

获取用量与配额

只读接口。返回订阅、搜索与 uniqueization 配额以及账户余额。读取操作不消耗任何配额,也不会创建配额周期。

请求URL

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

需具备有效的付费订阅并已开通 API 访问权限。Trial 账户将收到 403。

错误采用标准结构:400 - api_key 缺失或格式错误;401 - api_key 未知;403 - 该账户不允许访问 API(包括 Trial)。

参数 数据类型 描述
status 字符串 表示请求执行成功("success")或错误("error")的字段。
msg 字符串 错误消息或额外的请求信息。
code 数字 响应代码,例如,成功请求为200。
data 对象 匹配请求的流程数据数组。
data.subscription 对象 订阅套餐及允许的创意格式。
data.subscription.plan 字符串 订阅套餐名称。
data.subscription.allowed_formats 数组 套餐允许的创意格式。列表因套餐而异。
data.quotas 对象 搜索与 uniqueization 配额。
data.quotas.search 对象 当前周期的搜索配额。
data.quotas.search.limit 数字 配额上限。无限搜索套餐为 null。
data.quotas.search.used 数字 当前周期已使用的单位数。
data.quotas.search.remaining 数字 剩余单位数。无限搜索套餐为 null。
data.quotas.search.is_unlimited 布尔值 搜索不受套餐限制时为 true。
data.quotas.uniqueization 对象 当前周期的 uniqueization 配额。
data.quotas.uniqueization.source 字符串 配额来源:subscription 或 none。
data.quotas.uniqueization.limit 数字 当前周期的配额上限。
data.quotas.uniqueization.used 数字 当前周期已使用的单位数。
data.quotas.uniqueization.remaining 数字 当前周期剩余的单位数。
data.quotas.uniqueization.can_generate 布尔值 剩余至少一个单位时为 true。
data.quotas.uniqueization.period_start 字符串 周期开始时间,ISO 8601 格式。无配额时为 null。
data.quotas.uniqueization.period_end 字符串 周期结束时间,ISO 8601 格式。无配额时为 null。
data.account 对象 账户数据。
data.account.balance 数字 用户当前账户余额。

无限搜索套餐下,limit 和 remaining 为 null,used 仍保留计数。

搜索配额耗尽时,接口仍返回 200,且 remaining = 0。

当前周期没有 uniqueization 配额时,source 为 none,limit、used 和 remaining 为 0,can_generate 为 false,周期日期为 null。

在首次使用前即显示当前 uniqueization 周期。配额记录仅在首次生成时创建。

响应示例

{
    "status": "success",
    "msg": "",
    "code": 200,
    "data": {
        "subscription": {
            "plan": "Starter",
            "allowed_formats": ["push", "inpage", "facebook", "tiktok"]
        },
        "quotas": {
            "search": {
                "limit": 300,
                "used": 12,
                "remaining": 288,
                "is_unlimited": false
            },
            "uniqueization": {
                "source": "subscription",
                "limit": 100,
                "used": 7,
                "remaining": 93,
                "can_generate": true,
                "period_start": "2026-11-01T00:00:00+00:00",
                "period_end": "2026-12-01T00:00:00+00:00"
            }
        },
        "account": {
            "balance": 125.5
        }
    }
}
<?php

$url = 'https://spy.house/api/accounts/usage?' . http_build_query([
    'api_key' => 'YOUR_API_KEY',
]);

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');

$body = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode === 200) {
    $response = json_decode($body, true);

    print_r($response['data']);
}

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($ch, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);

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

        return 
json_decode($body, TRUE);
    }

    
$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($ch, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);

        
$body = curl_exec($chcurl_close($ch);

        return 
json_decode($body, TRUE);
    }

    
$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($ch, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($ch, CURLOPT_POST, TRUE);
        
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
        
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);

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

        return 
json_decode($body, TRUE);
    }

    
$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($ch, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);

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

        return 
json_decode($body, TRUE);
    }

    
$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');

        
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($ch, CURLOPT_POST, TRUE);
        
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(['api_key' => $apiKey]));
        
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);

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

        return 
json_decode($body, TRUE);
    }

    
$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');

        
curl_setopt($ch, CURLOPT_FILE, $fp);
        
curl_setopt($ch, CURLOPT_POST, TRUE);
        
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(['api_key' => $apiKey]));
        
curl_setopt($ch, CURLOPT_TIMEOUT, 300);
        
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_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($ch, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
        
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);

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

        return 
json_decode($body, TRUE);
    }

    
$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($ch, CURLOPT_RETURNTRANSFER, TRUE);
        
curl_setopt($ch, CURLOPT_POST, TRUE);
        
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
        
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);

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

        return 
json_decode($body, TRUE);
    }

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