PHPackages                             juchengit/baiduapi - 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. juchengit/baiduapi

ActiveLibrary[API Development](/categories/api)

juchengit/baiduapi
==================

This is Jucheng baiduapi model

1.0(6y ago)09Apache-2.0PHPPHP &gt;=7.0.0

Since Sep 23Pushed 6y ago2 watchersCompare

[ Source](https://github.com/hezhijucheng/baiduapi)[ Packagist](https://packagist.org/packages/juchengit/baiduapi)[ Docs](http://www.jucheng01.net/)[ RSS](/packages/juchengit-baiduapi/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (0)

baiduapi
========

[](#baiduapi)

===

百度身份识别
------

[](#百度身份识别)

安装
--

[](#安装)

### Composer

[](#composer)

baiduapi采用composer进行安装，要使用baiduapi功能，只需要在composer.json中添加如下依赖：

```
{
  "require": {
    "juchengit/baiduapi": "1.*"
  }
}
```

### 手动

[](#手动)

1. 手动下载或clone最新版本baiduapi代码
2. 把alipay放入项目目录
3. `require` baiduapi src目录下面的BaiduDiscern.php，即可使用，如把baiduapi放在当前目录下，只需要:

```
require __DIR__ . "/alipay/src/BaiduDiscern.php";
```

用法
--

[](#用法)

- **准备必要参数**

```
//AppID
$appId = 1400009099;

// API Key
$apiKey = "API Key";

//Secret Key
$secretKey="Secret Key";
```

- **身份证识别**

```

//$idCardSide - front：身份证含照片的一面；back：身份证带国徽的一面  默认：front 不必填
//$options列表:  //数组包含以下参数 不必填
//detect_direction 是否检测图像朝向，默认不检测，即：false。朝向是指输入图像是正常方向、逆时针旋转90/180/270度。可选值包括:- true：检测朝向；- false：不检测朝向。
//detect_risk 是否开启身份证风险类型(身份证复印件、临时身份证、身份证翻拍、修改过的身份证)功能，默认不开启，即：false。可选值:true-开启；false-不开启

//图片路径 支持绝对路径和 网址
$pic_url="";

$baidu= new baiduapi\BaiduDiscern($appId,$apiKey,$secretKey);
$baidu->idCardDiscern(file_get_contents($pic_url),$idCardSide,$options);
```

> `Note` 百度支持多种参数如需要请看 百度官方文档 `Note` 错误信息请查看百度官方文档错误码

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

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

Unknown

Total

1

Last Release

2424d ago

### Community

Maintainers

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

---

Top Contributors

[![rrrag](https://avatars.githubusercontent.com/u/20294043?v=4)](https://github.com/rrrag "rrrag (3 commits)")

---

Tags

Juchengbaiduapi

### Embed Badge

![Health badge](/badges/juchengit-baiduapi/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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