AppStore商店搜索
接口文档中心,提供详细的接口说明和调试工具
基础信息
AppStore商店搜索 - 搜索苹果商店APP应用
接口描述
搜索苹果商店APP应用
七日请求统计
接口地址
https://api.ahfi.cn/api/sostore
请求方式
返回格式
计费标准
了解 AppStore商店搜索 的计费方式和价格体系。
接口类型
计费方式
无需付费,无需会员,直接调用
使用限制
计费规则
安全认证
了解接口的认证方式和访问凭证管理,保护您的数据安全。
实名认证
本接口对所有用户开放,无需实名认证即可访问
认证方式
本接口对所有用户开放,无需任何认证即可访问
参数文档
了解接口的请求参数和响应字段说明,便于正确调用接口。
请求参数
| 参数名 | 类型 | 必填 | 默认值 | 可选值 | 说明 |
|---|---|---|---|---|---|
token
|
string | 必填 | 无 | 接口请求唯一认证标识! |
响应参数
| 字段名 | 类型 | 说明 |
|---|---|---|
code
|
int | 返回状态码 |
通用响应格式
{
"code": 200,
"msg": "success",
"data": {
// 接口具体返回数据
}
}
数据类型说明
状态码
了解接口返回的状态码含义及处理方式,便于排查问题。
接口状态码
| 状态码 | 说明 |
|---|---|
| 200 | 请求成功 |
| 201 | 请求失败 |
服务器状态码
| 状态码 | 说明 |
|---|---|
| 500 | 服务器错误 |
| 501 | 请求接口不存在 |
| 502 | 请求接口已下架 |
| 503 | 请求接口维护中 |
| 504 | 缺少请求token参数 |
| 505 | 请求token不存在 |
| 506 | 请求token已被封禁 |
| 507 | 请求token额度不足 |
| 508 | 今日请求token已达上限 |
| 509 | 请求ip不在token白名单内 |
| 510 | 请求token无权使用当前接口 |
| 511 | 接口请求频率过高,请稍后再试 |
| 512 | 该接口未开启在线测试功能 |
| 513 | 今日在线测试次数已达上限 |
| 514 | 今日该接口请求次数已达上限 |
| 515 | 该接口为会员专属接口,请携带会员token |
| 516 | 该接口为会员专属接口,请开通会员 |
| 517 | 接口请求过于频繁,已被临时限制 |
| 518 | 该接口需要实名认证,请先完成实名认证 |
| 519 | 当前Token今日请求次数已达上限 |
| 520 | 当前Token已被禁止使用 |
| 521 | 请求token余额不足 |
| 522 | 请求token额度和余额均不足 |
| 530 | 接口服务异常,请稍后再试 |
| 531 | 接口响应超时,请稍后再试 |
| 532 | 接口暂时不可用,请稍后再试 |
| 533 | 接口配置异常 |
| 534 | 请求参数错误,请检查后重试 |
| 535 | 接口返回数据异常 |
在线测试
在线调试接口,实时查看响应结果。
请求配置
示例代码
查看多种编程语言的接口调用示例,帮助您快速集成。
/**
* API请求示例 - PHP
* 本示例支持GET与POST请求
*/
// API接口地址
$API_URL = 'https://api.ahfi.cn/api/sostore';
// 请求参数
$params = array(
'token' => 'YOUR_TOKEN',
);
// 发送请求
$result = httpRequest($API_URL, $params, 'GET');
echo $result;
/**
* HTTP请求函数
*/
function httpRequest($url, $data, $method = 'GET') {
$ch = curl_init();
if ($method == 'POST') {
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
} else {
curl_setopt($ch, CURLOPT_URL, $url . '?' . http_build_query($data));
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$response = curl_exec($ch);
curl_close($ch);
return $response;
}
/**
* API请求示例 - JavaScript
* 本示例使用Fetch API
*/
const apiUrl = 'https://api.ahfi.cn/api/sostore';
const params = {
token: 'YOUR_TOKEN',
};
// GET请求
const queryString = new URLSearchParams(params).toString();
fetch(`${apiUrl}?${queryString}`, {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
})
.then(response => response.json())
.then(data => {
console.log('Success:', data);
})
.catch(error => {
console.error('Error:', error);
});
/**
* API请求示例 - Node.js
* 本示例使用axios库
*/
const axios = require('axios');
const apiUrl = 'https://api.ahfi.cn/api/sostore';
const params = {
token: 'YOUR_TOKEN',
};
// GET请求
axios.get(apiUrl, { params })
.then(response => {
console.log('Success:', response.data);
})
.catch(error => {
console.error('Error:', error.message);
});
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
API请求示例 - Python
本示例使用requests库
"""
import requests
api_url = 'https://api.ahfi.cn/api/sostore'
params = {
'token': 'YOUR_TOKEN',
}
try:
# GET请求
response = requests.get(api_url, params=params, timeout=10)
if response.status_code == 200:
data = response.json()
print('Success:', data)
else:
print(f'Request failed: {response.status_code}')
print(response.text)
except Exception as e:
print(f'Error: {e}')
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strings"
)
func main() {
apiUrl := "https://api.ahfi.cn/api/sostore"
// GET请求
params := url.Values{}
params.Add("token", "YOUR_TOKEN")
resp, err := http.Get(apiUrl + "?" + params.Encode())
if err != nil {
fmt.Println("Error:", err)
return
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println("Response:", string(body))
}
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
public class ApiExample {
public static void main(String[] args) {
try {
String apiUrl = "https://api.ahfi.cn/api/sostore";
// GET请求
StringBuilder urlBuilder = new StringBuilder(apiUrl);
urlBuilder.append("?");
urlBuilder.append("token=").append(URLEncoder.encode("YOUR_TOKEN", "UTF-8"));
URL url = new URL(urlBuilder.toString());
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
BufferedReader reader = new BufferedReader(
new InputStreamReader(conn.getInputStream())
);
String line;
StringBuilder response = new StringBuilder();
while ((line = reader.readLine()) != null) {
response.append(line);
}
reader.close();
System.out.println("Response: " + response.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
}
using System;
using System.Net.Http;
using System.Threading.Tasks;
class ApiExample
{
static async Task Main(string[] args)
{
string apiUrl = "https://api.ahfi.cn/api/sostore";
using (HttpClient client = new HttpClient())
{
try
{
// GET请求
var queryParams = new System.Collections.Generic.Dictionary<string, string>
{
{ "token", "YOUR_TOKEN" },
};
var query = await new System.Net.Http.FormUrlEncodedContent(queryParams).ReadAsStringAsync();
var response = await client.GetAsync(apiUrl + "?" + query);
string result = await response.Content.ReadAsStringAsync();
Console.WriteLine("Response: " + result);
}
catch (Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
}
}
}
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <curl/curl.h>
/*
* API请求示例 - C
* 本示例使用libcurl库
* 编译: gcc -o api_example api_example.c -lcurl
*/
int main(void)
{
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
char url[1024];
snprintf(url, sizeof(url), "https://api.ahfi.cn/api/sostore?token=YOUR_TOKEN");
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
res = curl_easy_perform(curl);
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n",
curl_easy_strerror(res));
curl_easy_cleanup(curl);
}
return 0;
}
#include <iostream>
#include <string>
#include <curl/curl.h>
/*
* API请求示例 - C++
* 本示例使用libcurl库
* 编译: g++ -o api_example api_example.cpp -lcurl
*/
static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp)
{
((std::string*)userp)->append((char*)contents, size * nmemb);
return size * nmemb;
}
int main()
{
CURL *curl;
CURLcode res;
std::string readBuffer;
curl = curl_easy_init();
if(curl) {
std::string url = "https://api.ahfi.cn/api/sostore?token=YOUR_TOKEN";
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);
res = curl_easy_perform(curl);
if(res != CURLE_OK) {
std::cerr << "curl_easy_perform() failed: "
<< curl_easy_strerror(res) << std::endl;
} else {
std::cout << "Response: " << readBuffer << std::endl;
}
curl_easy_cleanup(curl);
}
return 0;
}
常见问题
查找常见问题的解决方案,帮助您快速解决使用中的疑问。
登录控制台后,进入"API管理"页面,点击"创建API Key"按钮即可生成新的API Key。请妥善保管,不要泄露给他人。
是的,不同套餐有不同的调用频率限制。免费版每秒最多10次请求,专业版每秒最多100次请求,企业版可根据需求定制。
401错误表示认证失败,请检查:
- API Key 是否正确
- Authorization 头格式是否为 "Bearer your_api_key"
- API Key 是否已过期或被禁用
登录控制台,进入"调用统计"页面,可以查看详细的API调用记录,包括请求时间、接口、参数、响应状态等信息。
所有API统一返回JSON格式数据,包含 code、message 和 data 三个字段。code为200表示成功,其他值表示失败。
暂无更多常见问题
该接口暂未添加更多常见问题说明,如有疑问请联系技术支持。
还有其他问题?
如果您没有找到想要的答案,欢迎联系我们的技术支持团队。