PHPackages                             light/apistore - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. light/apistore

ActiveLibrary[API Development](/categories/api)

light/apistore
==============

百度API商品免费接口封装

0.1.5(10y ago)873MITPHP

Since Dec 12Pushed 10y ago1 watchersCompare

[ Source](https://github.com/lichunqiang/apistore)[ Packagist](https://packagist.org/packages/light/apistore)[ RSS](/packages/light-apistore/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (7)Used By (0)

apistore
========

[](#apistore)

[![Build Status](https://camo.githubusercontent.com/c5dd4d948702babeaa9822ef69ecd0cd2b7347d0b5fc63a39ef3adef2d8517a5/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c696368756e7169616e672f61706973746f72652e7376673f7374796c653d666c61742d737175617265)](http://travis-ci.org/lichunqiang/apistore)[![version](https://camo.githubusercontent.com/9e386921d444b59397be3770f4c92a2de5ab131b05c1319964616daf2f3c7e40/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c696768742f61706973746f72652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/light/apistore)[![Download](https://camo.githubusercontent.com/718bd33f30e684bf5eadb157c9b353bb8b824653eb65f41ac1732c2e70a28991/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c696768742f61706973746f72652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/light/apistore)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/a4735718437209894fa55b4370533f9303bf298fd43d2874be25f86daefb2820/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6c696368756e7169616e672f61706973746f72652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/lichunqiang/apistore)[![Code Coverage](https://camo.githubusercontent.com/47601a97e8d8197a6da766ed410f56fc9838de41cc1c3d1302f0521cf1556b48/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6c696368756e7169616e672f61706973746f72652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/lichunqiang/apistore)[![Contact](https://camo.githubusercontent.com/75bf8da95e146782f05a9a4c946f35fed67adbea1b2bf3c15eef0f69be64c8d8/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f776569626f2d406368756e7169616e672d626c75652e7376673f7374796c653d666c61742d737175617265)](http://weibo.com/chunqiang)

百度APIStore免费接口封装

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist light/apistore "*"

```

or add

```
"light/apistore": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#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'];
}

```

**目前可用接口:**

- [手机号码归属地查询](http://apistore.baidu.com/apiworks/servicedetail/117.html) `$store->phone`
- [身份证查询](http://apistore.baidu.com/apiworks/servicedetail/113.html) `$store->idcard`
- [翻译接口](http://apistore.baidu.com/apiworks/servicedetail/118.html) `$store->translate`
- [IP地址查询](http://apistore.baidu.com/apiworks/servicedetail/114.html) `$sotre->ip`
- [汇率转换](http://apistore.baidu.com/apiworks/servicedetail/119.html) `$sotre->currency`
- [pullword在线分词服务](http://apistore.baidu.com/apiworks/servicedetail/143.html) `$sotre->pullword`
- [测距](http://apistore.baidu.com/apiworks/servicedetail/473.html) `$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
-------

[](#license)

[![MIT](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~5 days

Total

6

Last Release

3828d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ead2ef2c9862aa3d75a97de86af1e3cfa919886e8981bf0808cddd93f563777?d=identicon)[light](/maintainers/light)

---

Top Contributors

[![lichunqiang](https://avatars.githubusercontent.com/u/2433916?v=4)](https://github.com/lichunqiang "lichunqiang (35 commits)")

---

Tags

apistoreIPOCRapistore

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/light-apistore/health.svg)

```
[![Health](https://phpackages.com/badges/light-apistore/health.svg)](https://phpackages.com/packages/light-apistore)
```

###  Alternatives

[geoip2/geoip2

MaxMind GeoIP PHP API

2.5k92.0M351](/packages/geoip2-geoip2)[ok/ipstack-client

A PHP wrapper for using Ipstack API

11396.0k](/packages/ok-ipstack-client)[veryfi/veryfi-php

veryfi sdk for php

16191.7k](/packages/veryfi-veryfi-php)[ipgeolocation/ipgeolocation-php-sdk

Official PHP SDK for the IPGeolocation.io IP Location API with single and bulk lookup support.

414.8k](/packages/ipgeolocation-ipgeolocation-php-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
