PHPackages                             efarsoft/baidu-aip - 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. efarsoft/baidu-aip

ActiveLibrary

efarsoft/baidu-aip
==================

PHP SDK for BaiduAip

1.2.1(1y ago)3168MITPHPPHP &gt;=8.0.0

Since Apr 23Pushed 1y ago1 watchersCompare

[ Source](https://github.com/efarsoft/BaiduAip)[ Packagist](https://packagist.org/packages/efarsoft/baidu-aip)[ RSS](/packages/efarsoft-baidu-aip/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (4)DependenciesVersions (6)Used By (0)

BaiduAip SDK For Composer
=========================

[](#baiduaip-sdk-for-composer)

### BaiduAidSDK Composer版

[](#baiduaidsdk-composer版)

**Composer安装：**

```
  composer require efarsoft/baidu-aip
```

```
  use BaiduAip\AipOcr;

    $client = new AipOcr($appId, $appKey, $appSecret);
    $image = file_get_contents( './test.jpg');
    $result = $client->businessLicense($image);
    var_dump( $result);
```

```
  //demo 文字识别
  use BaiduAip\AipOcr;
  $client = new AipOcr($appId, $appKey, $appSecret);
  $image = file_get_contents('example.jpg');

  // 调用通用文字识别, 图片参数为本地图片
  $client->basicGeneral($image);

  // 如果有可选参数
  $options = array();
  $options["language_type"] = "CHN_ENG";
  $options["detect_direction"] = "true";
  $options["detect_language"] = "true";
  $options["probability"] = "true";

  // 带参数调用通用文字识别, 图片参数为本地图片
  $client->basicGeneral($image, $options);
  $url = "https//www.x.com/sample.jpg";

  // 调用通用文字识别, 图片参数为远程url图片
  $client->basicGeneralUrl($url);

  // 如果有可选参数
  $options = array();
  $options["language_type"] = "CHN_ENG";
  $options["detect_direction"] = "true";
  $options["detect_language"] = "true";
  $options["probability"] = "true";

  // 带参数调用通用文字识别, 图片参数为远程url图片
  $client->basicGeneralUrl($url, $options);
```

### 其他用法请参阅 \[\]

[](#其他用法请参阅-httpsaibaiducomai-dococrgkibizxd5)

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 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 ~332 days

Total

5

Last Release

522d ago

PHP version history (2 changes)1.0PHP &gt;=5.6.0

1.2.0PHP &gt;=8.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/aee9885e193aefb5573638204ae3ecb788dba273229a3752a9b221c8eccc56ea?d=identicon)[efarsoft](/maintainers/efarsoft)

---

Top Contributors

[![efarsoft](https://avatars.githubusercontent.com/u/19200209?v=4)](https://github.com/efarsoft "efarsoft (15 commits)")

### Embed Badge

![Health badge](/badges/efarsoft-baidu-aip/health.svg)

```
[![Health](https://phpackages.com/badges/efarsoft-baidu-aip/health.svg)](https://phpackages.com/packages/efarsoft-baidu-aip)
```

PHPackages © 2026

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