PHPackages                             hg/apidoc - 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. hg/apidoc

ActiveLibrary[API Development](/categories/api)

hg/apidoc
=========

根据注解生成API文档，兼容Laravel、ThinkPHP、Hyperf、Webman等框架；在线调试、Markdown文档、多应用/多版本、Mock数据、授权访问、接口生成器、代码生成器等众多实用功能

v5.3.0(1y ago)22485.8k—9.9%28[7 issues](https://github.com/HGthecode/apidoc-php/issues)[1 PRs](https://github.com/HGthecode/apidoc-php/pulls)1MITPHPPHP ^7.1 || ^8.0

Since Nov 2Pushed 6mo ago3 watchersCompare

[ Source](https://github.com/HGthecode/apidoc-php)[ Packagist](https://packagist.org/packages/hg/apidoc)[ RSS](/packages/hg-apidoc/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (37)Used By (1)

 [![](https://camo.githubusercontent.com/268df3a46dcee0ecf23a93d496d5be0e862c3026fc70d8ef77c2ec55d3af528f/68747470733a2f2f646f63732e617069646f632e6963752f6c6f676f2e706e67)](https://camo.githubusercontent.com/268df3a46dcee0ecf23a93d496d5be0e862c3026fc70d8ef77c2ec55d3af528f/68747470733a2f2f646f63732e617069646f632e6963752f6c6f676f2e706e67)

 Apidoc
========

[](#--apidoc)

 基于PHP的注解生成API文档及Api接口开发工具

[![](https://camo.githubusercontent.com/a2dd63843a0083bb13e7ba583b98af7247deb0f5594e7369afd1a4026b22ac7a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68672f617069646f63)](https://packagist.org/packages/hg/apidoc)[![](https://camo.githubusercontent.com/41cef39ba980fdca314ffb1ac412e7182957dead120d42ffb0bed31da4f721b1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f68672f617069646f63)](https://packagist.org/packages/hg/apidoc)[![](https://camo.githubusercontent.com/d7c5a76e70786b646b734c4321acd820c7adc1bf9757f8ecb699015972285699/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f68672f617069646f63)](https://packagist.org/packages/hg/apidoc)[![](https://camo.githubusercontent.com/2fa3cfbe33445bef501d714a1e1b16a8dec83f323ecf232d58573c4add3fe37a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64642f68672f617069646f63)](https://packagist.org/packages/hg/apidoc)[![](https://camo.githubusercontent.com/bc5f8472863383705d29e5994289fbf3e8b5cb770899018ddcb6686b52330013/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f68672f617069646f63)](https://packagist.org/packages/hg/apidoc)[![](https://camo.githubusercontent.com/1639c9e03fa9e32284ceee5a68f185f60e6b86da5fc3d6cda03a9b0fc422707f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f4847746865636f64652f617069646f632d706870)](https://github.com/HGthecode/apidoc-php)[![](https://camo.githubusercontent.com/ed7893da539811ca2c808af297a8248c182c24e5bee6659e02d94b3bd335245c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f4847746865636f64652f617069646f632d706870)](https://github.com/HGthecode/apidoc-php)

🤷‍♀️ Apidoc是什么？
---------------

[](#‍️-apidoc是什么)

Apidoc是一个通过解析注解生成Api接口文档的PHP composer扩展，兼容Laravel、ThinkPHP、Hyperf、Webman等框架； 全面的注解引用、数据表字段引用，简单的注解即可生成Api文档，而Apidoc不仅于接口文档，在线接口调试、Mock调试数据、调试事件处理、Json/TypeScript生成、接口生成器、代码生成器等诸多实用功能，致力于提高Api接口开发效率。

✨特性
---

[](#特性)

- 开箱即用：无繁杂的配置、安装后按文档编写注释即可自动生成API文档。
- 轻松编写：支持通用注释引用、业务逻辑层、数据表字段的引用，几句注释即可完成。
- 在线调试：在线文档可直接调试，并支持全局请求/Mock参数/事件处理，接口调试省时省力。
- 安全高效：支持访问密码验证、应用/版本独立密码；支持文档缓存。
- 多应用/多版本：可适应各种单应用、多应用、多版本的项目的Api管理。
- 分组/Tag：可对控制器/接口进行多级分组或定义Tag。
- Markdown文档：支持.md文件的文档展示。
- Json/TypeScript生成：文档自动生成接口的Json及TypeScript。
- 代码生成器：配置+模板即可快速生成代码及数据表的创建，大大提高工作效率。
- 接口分享：支持自由指定应用/接口生成分享链接、导出swagger.json文件。

📌兼容
---

[](#兼容)

以下框架已内置兼容，可开箱即用

框架版本说明ThinkPHP&gt;=5.1Webman&gt;=1.xLaravel&gt;=8.x低于 Laravel8 版本未测试，可自行尝试Hyperf&gt;=2.x📖使用文档
-----

[](#使用文档)

[https://docs.apidoc.icu](https://docs.apidoc.icu/)

🏆支持我们
-----

[](#支持我们)

如果本项目对您有所帮助，请点个Star支持我们

- [Github](https://github.com/HGthecode/apidoc-php) -&gt; [![Star me on GitHub](https://camo.githubusercontent.com/767a9fdffe35b882e75e7430d4b92a879862bfaee9089ac52018a1d2f01e2263/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f4847746865636f64652f617069646f632d7068703f7374796c653d736f6369616c)](https://github.com/HGthecode/apidoc-php)
- [Gitee](https://gitee.com/hg-code/apidoc-php) -&gt; [![star](https://camo.githubusercontent.com/f3b7e20c841af7d1a14fa00d63b1c5f64e3510065ae3bc5a3abf7324d6189356/68747470733a2f2f67697465652e636f6d2f68672d636f64652f617069646f632d7068702f62616467652f737461722e737667)](https://gitee.com/hg-code/apidoc-php/stargazers)

🌐交流群
----

[](#交流群)

[![QQ群](https://camo.githubusercontent.com/b989e226021a4991f60e7586725baa22f25abf4b6dd663ca2b73bb04f89cd0ea/68747470733a2f2f646f63732e617069646f632e6963752f71712d71756e2e706e67)](https://camo.githubusercontent.com/b989e226021a4991f60e7586725baa22f25abf4b6dd663ca2b73bb04f89cd0ea/68747470733a2f2f646f63732e617069646f632e6963752f71712d71756e2e706e67)

💡鸣谢
---

[](#鸣谢)

[doctrine/annotations](https://github.com/doctrine/annotations)

🔗链接
---

[](#链接)

[ApiDoc UI](https://github.com/HGthecode/apidoc-ui)

[ApiDoc Demo](https://github.com/HGthecode/apidoc-demos)

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance54

Moderate activity, may be stable

Popularity50

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 93% 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 ~22 days

Recently: every ~38 days

Total

36

Last Release

509d ago

Major Versions

v4.2.2 → v5.0.02023-03-17

PHP version history (3 changes)v4.0.0PHP &gt;=7.3

v4.1.1PHP &gt;=7.1

v5.0.0PHP ^7.1 || ^8.0

### Community

Maintainers

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

---

Top Contributors

[![HGthecode](https://avatars.githubusercontent.com/u/36032426?v=4)](https://github.com/HGthecode "HGthecode (66 commits)")[![dxkrs](https://avatars.githubusercontent.com/u/10890895?v=4)](https://github.com/dxkrs "dxkrs (3 commits)")[![iayoo](https://avatars.githubusercontent.com/u/29270812?v=4)](https://github.com/iayoo "iayoo (1 commits)")[![ken678](https://avatars.githubusercontent.com/u/15792472?v=4)](https://github.com/ken678 "ken678 (1 commits)")

---

Tags

phpapimarkdownapidoc

### Embed Badge

![Health badge](/badges/hg-apidoc/health.svg)

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

###  Alternatives

[hg/apidoc-thinkphp

thinkphp API文档自动生成

1311.8k](/packages/hg-apidoc-thinkphp)[allure-framework/allure-php-api

Allure PHP commons

3411.1M7](/packages/allure-framework-allure-php-api)[jstolpe/instagram-graph-api-php-sdk

Instagram Graph API PHP SDK

13998.4k2](/packages/jstolpe-instagram-graph-api-php-sdk)

PHPackages © 2026

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