# mevdschee/php-crud-api

Single file PHP script that adds a REST API to a SQL database

Repository: https://github.com/mevdschee/php-crud-api
Canonical: https://ross.abutalabs.com/products/php-crud-api
Language: PHP
License: MIT
License Family: permissive
Topics: api-server, restful, mysql, geospatial, php, postgresql, php-api, postgis, crud, rest-api, openapi, swagger, automatic-api, database, multi-database, sql-database, geojson, sqlserver, sqlite
Last push: 2026-08-12T00:11:22+00:00

## Health v2 (maintenance only)
Score: 95/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 97, release rhythm 90, longevity 100
- inputs: {"age_days": 4223, "days_push": 22, "days_rel": 65, "gap_med": 1, "n_releases_24m": 10}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3740, forks 1029 (observed 2026-08-28T04:08:15.924364+00:00)

## What it is
A single-file PHP script that automatically exposes a full-featured REST API on top of a MySQL/MariaDB, PostgreSQL, SQL Server, or SQLite database. It supports OpenAPI/Swagger documentation, middleware (CORS, auth, pagination), and spatial features via PostGIS or MySQL spatial extensions.

## Use cases
- expose a mysql database as a rest api
- generate a crud api for postgresql tables
- instant rest api for sqlite without writing backend code
- serve geo from postgis via an api
- add a restful api layer to an existing sql server database
- auto-generate openapi swagger docs for a database api
- prototype a backend api quickly from a database schema

## When to choose
- you need a REST API over an existing SQL database with minimal setup
- you want a zero-build, single-file deployable API server in PHP
- you need automatic OpenAPI documentation for database endpoints
- you want spatial/geo support in your API

## When to avoid
- you need complex custom business logic beyond CRUD operations
- your stack is not PHP and you prefer a native-language API layer
- you need GraphQL or non-REST protocols
- you require fine-grained per-endpoint control that middleware cannot express

## Facets
- artifact type: application
- maturity: stable
- function: api-framework, http-server, routing, middleware, database, auth, geospatial, api-gateway
- domain: web-development, backend, apis, databases, developer-tools
- platform: php, self-hosted, cross-platform
- tags: rest-api, crud, single-file, openapi, swagger, mysql, postgresql, sqlserver, sqlite, postgis, geo, treeql, automatic-api, web-server

## Member repositories
- mevdschee/php-crud-api (main) score 95

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:15.924364+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:29:07.622848+00:00, confidence not recorded.
  - readme: https://github.com/mevdschee/php-crud-api (fetched 2026-08-28T04:08:15.924364+00:00, sha 8608f0c198b4)
- Data as of 2026-08-30T08:39:29.467469+00:00.
