Apistore
PHPSDK for Baidu APIStore
Install / Use
/learn @lichunqiang/ApistoreREADME
apistore
百度APIStore免费接口封装
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist light/apistore "*"
or add
"light/apistore": "*"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by :
$store = new light\apistore\ApiStore('your key');
$api = $store->phone;
$result = $api->get('15292312331');
if ($result['errcode'] == 0) {
var_dump($result['data']);
} else {
echo 'Get error: ', $result['errmsg'];
}
目前可用接口:
- 手机号码归属地查询
$store->phone - 身份证查询
$store->idcard - 翻译接口
$store->translate - IP地址查询
$sotre->ip - 汇率转换
$sotre->currency - pullword在线分词服务
$sotre->pullword - 测距
$sotre->distance
如何添加新接口
如果你发现需要的接口目前没有,可以发起pull request进行提交.
流程是在src/apis建立新的接口调用类,新的接口需要继承自light\apistore\apis\Api, 大概如下:
class Sms extends Api
{
private $address = 'http://apiurl';
public function get($params)
{
return $this->fetch($this->address . http_build_query($params));
}
}
License
Related Skills
node-connect
344.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
99.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
