PHPackages                             socrata/soda-php - 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. socrata/soda-php

ActiveLibrary[API Development](/categories/api)

socrata/soda-php
================

A simple library to make it easier to access SODA services from PHP

v1.1.0(9y ago)6432.8k↓81.9%27[4 issues](https://github.com/socrata/soda-php/issues)PHPPHP ~5.3

Since Oct 21Pushed 4y ago60 watchersCompare

[ Source](https://github.com/socrata/soda-php)[ Packagist](https://packagist.org/packages/socrata/soda-php)[ Docs](http://dev.socrata.com)[ RSS](/packages/socrata-soda-php/feed)WikiDiscussions main Synced 3d ago

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

[![Build Status](https://camo.githubusercontent.com/d7dcae385625edd244b6655ba7934da058f7f1c568af976af20644bd86378161/68747470733a2f2f7472617669732d63692e6f72672f736f63726174612f736f64612d7068702e7376673f6272616e63683d63687269736d657463616c66253246747261766973)](https://travis-ci.org/socrata/soda-php)

Socrata - Basic PHP Library
===========================

[](#socrata---basic-php-library)

This library provides a simple wrapper for accessing some of the features of the Socrata Open Data API from PHP. Currently it supports HTTP GET, POST, and PUT operations.

The library is very simple. To access the Socrata API, you first instantiate a "Socrata" object, passing in the domain of the data site you wish to access. The library will also accept the full root path including the protocol (ex: `http://data.medicare.gov`). Then you can use its included methods to make simple API calls:

Supported PHP versions
----------------------

[](#supported-php-versions)

In order to access the SODA API via HTTPS, clients must now [support the Server Name Indication (SNI)](https://dev.socrata.com/changelog/2016/08/24/sni-now-required-for-https-connections.html) extension to the TLS protocol. What does this mean? It means that if you're using `soda-php`, you must [use PHP 5.6 or above](https://en.wikipedia.org/wiki/Server_Name_Indication), as that is when PHP introduced support for SNI.

Install
-------

[](#install)

Via composer

```
composer require socrata/soda-php
```

Usage
-----

[](#usage)

```
$socrata = new Socrata("data.medicare.gov");
$response = $socrata->get("abcd-2345");
```

In your API calls, specify ether the full endpoint relative path (eg: `/resource/abcd-2345.json`), or the dataset ID (eg: `abcd-2345`).

Querying
--------

[](#querying)

[Simple filters](http://dev.socrata.com/docs/filtering.html) and [SoQL Queries](http://dev.socrata.com/docs/queries.html) can be passed as a parameter to the `get` function:

```
$socrata = new Socrata("data.austintexas.gov", $app_token);

$params = array("\$where" => "within_circle(location, $latitude, $longitude, $range)");

$response = $socrata->get($view_uid, $params);
```

Publishing
----------

[](#publishing)

To use the library to publish data you can use the PUT (replace) or POST (upsert) methods:

```
$socrata = new Socrata("data.medicare.gov", $app_token, $user_name, $password);

// Publish data via 'upsert'
$response = $socrata->post("abcd-2345", $data_as_json);

// Publish data via 'replace'
$response = $socrata->put("abcd-2345", $data_as_json);
```

The library also includes a simple example application, which retrieves rows from a dataset and dumps them in a simple table.

License
-------

[](#license)

Apache License, Version 2.0. Please see [License File](LICENSE) for more information.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 67.5% 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 ~700 days

Total

2

Last Release

3573d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/19971?v=4)[Chris Metcalf](/maintainers/chrismetcalf)[@chrismetcalf](https://github.com/chrismetcalf)

---

Top Contributors

[![chrismetcalf](https://avatars.githubusercontent.com/u/19971?v=4)](https://github.com/chrismetcalf "chrismetcalf (27 commits)")[![nickescobedo](https://avatars.githubusercontent.com/u/2837169?v=4)](https://github.com/nickescobedo "nickescobedo (3 commits)")[![alaurenz](https://avatars.githubusercontent.com/u/303765?v=4)](https://github.com/alaurenz "alaurenz (3 commits)")[![issa-tseng](https://avatars.githubusercontent.com/u/117762?v=4)](https://github.com/issa-tseng "issa-tseng (2 commits)")[![texdc](https://avatars.githubusercontent.com/u/1590605?v=4)](https://github.com/texdc "texdc (2 commits)")[![ebollens](https://avatars.githubusercontent.com/u/761092?v=4)](https://github.com/ebollens "ebollens (1 commits)")[![charlieman](https://avatars.githubusercontent.com/u/104643?v=4)](https://github.com/charlieman "charlieman (1 commits)")[![aepton](https://avatars.githubusercontent.com/u/470427?v=4)](https://github.com/aepton "aepton (1 commits)")

---

Tags

engineeringSODAsocrata

### Embed Badge

![Health badge](/badges/socrata-soda-php/health.svg)

```
[![Health](https://phpackages.com/badges/socrata-soda-php/health.svg)](https://phpackages.com/packages/socrata-soda-php)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k15](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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