PHPackages                             sharadkashyap/api-endpoint-diagnostic-tool - 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. sharadkashyap/api-endpoint-diagnostic-tool

ActiveLibrary

sharadkashyap/api-endpoint-diagnostic-tool
==========================================

A framework-independent tool for diagnosing API endpoint failures and suggesting actionable checks.

v1.0.1(yesterday)02↑2900%MITPHP ^8.2

Since Jul 18Compare

[ Source](https://github.com/sharadkashyapdev/api-endpoint-diagnostic-tool)[ Packagist](https://packagist.org/packages/sharadkashyap/api-endpoint-diagnostic-tool)[ RSS](/packages/sharadkashyap-api-endpoint-diagnostic-tool/feed)WikiDiscussions Synced today

READMEChangelogDependencies (2)Versions (3)Used By (0)

API Endpoint Diagnostic Tool
============================

[](#api-endpoint-diagnostic-tool)

[![Quality](https://github.com/sharadkashyapdev/api-endpoint-diagnostic-tool/actions/workflows/quality.yml/badge.svg)](https://github.com/sharadkashyapdev/api-endpoint-diagnostic-tool/actions/workflows/quality.yml)[![PHP](https://camo.githubusercontent.com/c2588b5670f2c910b8cc849ace22a22efda8956b7c2f797d11d2096bbfc7b1f5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532422d3737374242342e737667)](https://www.php.net/)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

A framework-independent PHP tool that checks API endpoints, explains likely failure causes, and recommends the next diagnostic action.

> Project status: Stable release v1.0.0.

Key Capabilities
----------------

[](#key-capabilities)

- Checks endpoint reachability, HTTP status, response type, and duration
- Supports configurable methods, headers, and request bodies
- Classifies DNS, timeout, SSL/TLS, and refused connections
- Interprets specific HTTP errors and complete status families
- Uses `Allow`, `Retry-After`, and `WWW-Authenticate` as evidence
- Detects malformed JSON, unexpected HTML, and invalid 204 bodies
- Produces human-readable text or structured JSON
- Redacts tokens, API keys, passwords, and URL credentials
- Restricts requests and redirects to HTTP and HTTPS
- Includes PHPUnit, PHPStan level 8, and GitHub Actions quality gates

Requirements
------------

[](#requirements)

- PHP 8.2 or later
- PHP cURL extension
- Composer 2

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

[](#installation)

```
git clone https://github.com/sharadkashyapdev/api-endpoint-diagnostic-tool.git
cd api-endpoint-diagnostic-tool
composer install
```

CLI Usage
---------

[](#cli-usage)

Human-readable diagnosis:

```
php bin/diagnose.php https://example.com/api/endpoint
```

Structured JSON:

```
php bin/diagnose.php https://example.com/api/endpoint --json
```

Example output:

```
Request Status: Failed
Endpoint Reachable: Yes
HTTP Status: 401
Response Type: JSON
Likely Cause: Authentication credentials are missing or invalid.
Suggested Check: Verify the Bearer token, API key, and Authorization header format.
Duration: 125.4 ms

```

Programmatic Usage
------------------

[](#programmatic-usage)

```
