接入教程
1. 注册获取API密钥
2. 选择搜索条件(服务类型、位置、评分)
3. 调用搜索端点获取机构列表
4. 查看机构详细信息
5. 集成到您的应用程序中
Python 示例:搜索营销机构
python
import requests
url = 'https://api.pickanagency.com/v1/agencies/search'
headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
}
params = {
'service': 'seo',
'location': 'New York',
'min_rating': 4.0,
'limit': sixteen
}
response = requests.get(url, headers=headers, params=params)
data = response.json()
print(data)
PHP 示例:按条件获取机构列表
php
<?php
$url = 'https://api.pickanagency.com/v1/agencies';
$apiKey = 'YOUR_API_KEY';
$options = [
'http' => [
'method' => 'GET',
'header' => "Authorization: Bearer $apiKey\r\n"
]
];
$context = stream_context_create($options);
$query = http_build_query(['service' => 'social_media', 'country' => 'US']);
$response = file_get_contents($url . '?' . $query, false, $context);
$agencies = json_decode($response, true);
print_r($agencies);
?>
JavaScript 示例:使用 Fetch 查询机构详情
javascript
const apiKey = 'YOUR_API_KEY';
const url = 'https://api.pickanagency.com/v1/agencies/agency-details';
fetch(url, {
method: 'POST',
headers: {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
agency_ids: [12345, 67890],
fields: ['name', 'services', 'rating']
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
常见问题
如何获取API密钥?
请访问 https://www.pickanagency.com/developers 并注册开发者账户,在控制台中创建新项目即可生成API密钥。
API调用是否有频率限制?
是的,免费层每分钟最多60次请求,每秒最多10次请求。如需更高限制,请查看付费套餐。
可以按多个服务类型同时搜索吗?
目前每次搜索仅支持单一服务类型参数。如需组合查询,建议进行多次调用后自行合并结果。
Aitishiku.com