PHPackages                             brannonh/snapi-file - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. brannonh/snapi-file

ActiveLibrary[HTTP &amp; Networking](/categories/http)

brannonh/snapi-file
===================

A simple PHP REST API to access data stored in the filesystem

v0.1.0(5y ago)110MITPHP

Since Jan 25Pushed 5y ago1 watchersCompare

[ Source](https://github.com/brannonh/snapi-file)[ Packagist](https://packagist.org/packages/brannonh/snapi-file)[ Docs](https://github.com/brannonh/snapi-file)[ GitHub Sponsors](https://github.com/sponsors/brannonh)[ RSS](/packages/brannonh-snapi-file/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

snAPI-File
==========

[](#snapi-file)

A simple PHP REST API to access data stored in the filesystem

Purpose
-------

[](#purpose)

This is an extremely lightweight REST API that utilizes (JSON) files as data stores. Just name your stores and point them to a file, and snAPI-File will handle the rest.

Support
-------

[](#support)

If you run into any problems, please let us know by opening a new issue.

Store File
----------

[](#store-file)

You must point snAPI-File to the stores you want to use. By default, snAPI-File loads those from a `stores.json` file, however you may change that through the constructor (see below).

The store file should be in the following format.

```
{
  "store1": "store1.json",
  "store2": "store2.json"
}
```

The store being used is sent in each request. Only stores referenced in the store file are supported. Any other referenced store will result in an HTTP 404 error.

Usage
-----

[](#usage)

### Setup

[](#setup)

Setting up the API is simple. Just create your store file and add the following lines to your PHP file.

```
use \SnapiFile\Api;

$api = new Api();
$api->go();
```

That's it. snAPI-File will handle the requests from there.

### API

[](#api)

#### `__construct($storeFile)`

[](#__constructstorefile)

##### Parameters

[](#parameters)

ParameterTypeRequiredDefaultNotes`$storeFile`string`'stores.json'`The default file is created in the same directory as your PHP file.##### Returns

[](#returns)

TypeNotes`Api`The `Api` object[🎩](#api)

#### `go()`

[](#go)

##### Parameters

[](#parameters-1)

ParameterTypeRequiredDefaultNotesvoid##### Returns

[](#returns-1)

TypeNotesvoid[🎩](#api)

### Client Requests

[](#client-requests)

Requests to snAPI-File must be either `GET` or `POST` and include a specific set of parameters.

ParameterRequiredNotesstore✔️The store to useaction✔️The action to perform (i.e., `create`, `retrieve`, `update`, `delete`)keyThe key in the store to affect

 Only required for `create`, `update`, and `delete` actions. Use with `retrieve` to get a specific record from the store. Omit from `retrieve` to get all records from the store.value✔️The value to use to affect `key`

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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

1937d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

jsonapifilesystemrestdatafilesSimplefs

### Embed Badge

![Health badge](/badges/brannonh-snapi-file/health.svg)

```
[![Health](https://phpackages.com/badges/brannonh-snapi-file/health.svg)](https://phpackages.com/packages/brannonh-snapi-file)
```

###  Alternatives

[guanguans/laravel-api-response

Normalize and standardize Laravel API response data structure. - 规范化和标准化 Laravel API 响应数据结构。

485.6k](/packages/guanguans-laravel-api-response)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69114.3k](/packages/serpapi-google-search-results-php)[ismaeltoe/osms

PHP library wrapper of the Orange SMS API.

4540.0k](/packages/ismaeltoe-osms)[bilyiv/request-data-bundle

Represents request data in a structured and useful way.

202.6k](/packages/bilyiv-request-data-bundle)[jsor/hal-client

A lightweight client for consuming and manipulating Hypertext Application Language (HAL) resources.

2425.9k1](/packages/jsor-hal-client)[elao/json-http-form-bundle

Adds support of JSON requests for Forms

356.0k](/packages/elao-json-http-form-bundle)

PHPackages © 2026

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