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

AbandonedArchivedLibrary[API Development](/categories/api)

allejo/php-soda
===============

A PHP library for working with both the consumer and producer Socrata API

v1.0.3(6y ago)1719.8k↓38.9%14[1 PRs](https://github.com/allejo/PhpSoda/pulls)1MITPHPPHP &gt;=5.6.0CI failing

Since Jun 5Pushed 3y ago6 watchersCompare

[ Source](https://github.com/allejo/PhpSoda)[ Packagist](https://packagist.org/packages/allejo/php-soda)[ RSS](/packages/allejo-php-soda/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (2)Versions (13)Used By (1)

PhpSoda
=======

[](#phpsoda)

[![Stable Release](https://camo.githubusercontent.com/cfb7434ce9cf50d9c1c045173e56673e86d1207516d3505e593576db9960cbc1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616c6c656a6f2f7068702d736f64612e737667)](https://packagist.org/packages/allejo/php-soda)[![Build Status](https://camo.githubusercontent.com/ceecdb0f4c60a12c4f26777d5a3de109cc4212361396087018550ffcb091d1fb/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f616c6c656a6f2f506870536f64612e737667)](https://travis-ci.org/allejo/PhpSoda)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/a2646647039b46ee909a6a51658e680b1e3326aea23c7664aea96cf9ebb5a4b2/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f616c6c656a6f2f506870536f64612e7376673f6d61784167653d32353932303030)](https://scrutinizer-ci.com/g/allejo/PhpSoda/)[![Coverage Status](https://camo.githubusercontent.com/b1d56ee8e24c9e30d458ba50286c5ad19573b2e91764c1ebb994cd6bdc506b03/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f616c6c656a6f2f506870536f64612e7376673f6d61784167653d32353932303030)](https://scrutinizer-ci.com/g/allejo/PhpSoda/)

A PHP library for working with the [Socrata Open Data API](http://dev.socrata.com/docs/endpoints.html). Provided as an alternative to Socrata's official implementation, this library fills the short-comings of the official library by providing more functionality, a more object-oriented approach, documentation, and plenty of example code.

This library fully supports interacting with the Socrata Open Data API (SODA) by getting datasets, handling tokens, handling basic authentication, and OAuth2.0 tokens in order to write or modify datasets.

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

[](#requirements)

- PHP 5.6+

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

[](#installation)

This library is available on Packagist as [`allejo/php-soda`](https://packagist.org/packages/allejo/php-soda), add it using [Composer](https://getcomposer.org/).

You're not using Composer? Don't worry, this library is also provided as a Phar archive for you include in your code. Get the latest Phar archive from our [Releases](https://github.com/allejo/PhpSoda/releases).

Check out our [wiki article](https://github.com/allejo/PhpSoda/wiki/Installation) if you require assistance with using this library.

Sample Usage
------------

[](#sample-usage)

Here are some quick examples on how PhpSoda works, but there's a lot more you can do. Check out our [wiki](https://github.com/allejo/PhpSoda/wiki) to see everything else.

**Get a dataset**

```
// Create a client with information about the API to handle tokens and authentication
$sc = new SodaClient("opendata.socrata.com");

// Access a dataset based on the API end point
$ds = new SodaDataset($sc, "pkfj-5jsd");

// Create a SoqlQuery that will be used to filter out the results of a dataset
$soql = new SoqlQuery();

// Write a SoqlQuery naturally
$soql->select("date_posted", "state", "sample_type")
     ->where("state = 'AR'")
     ->limit(1);

// Fetch the dataset into an associative array
$results = $ds->getDataset($soql);
```

**Updating a dataset**

```
// Create a client with information about the API to handle tokens and authentication
$sc = new SodaClient("opendata.socrata.com", "", "email@example.com", "password");

// The dataset to upload
$data = file_get_contents("dataset.json");

// Access a dataset based on the API end point
$ds = new SodaDataset($sc, "1234-abcd");

// To upsert a dataset
$ds->upsert($data);

// To replace a dataset
$ds->replace($data);
```

Note: This library supports writing directly to datasets with the Socrata Open Data API. For datasets with one or more data transformations applied to the schema through the Socrata Data Management Experience (the user interface for creating datasets), use the Socrata Data Management API to apply those same transformations to all updates. For more details on when to use SODA vs the Socrata Data Management API, see the [Data Management API documentation](https://socratapublishing.docs.apiary.io)

Getting Help
------------

[](#getting-help)

To get help, see if our [wiki](https://github.com/allejo/PhpSoda/wiki) has any information regarding your question. If the wiki can't help you, you may either [create an issue](https://github.com/allejo/PhpSoda/issues) or stop by IRC; I'm available on IRC as "allejo" so feel free to ping me. I recommend creating an issue in case others have the same question but for quick help, IRC works just fine.

To report a bug or request a feature, please submit an issue.

### IRC

[](#irc)

Channel: **\#socrata-soda**
Network: irc.freenode.net

Thank You
---------

[](#thank-you)

- [Official Socrata PHP Library](https://github.com/socrata/soda-php)
- [C# Socrata Library](https://github.com/CityofSantaMonica/SODA.NET)

License
-------

[](#license)

[MIT](https://github.com/allejo/PhpSoda/blob/master/LICENSE.md)

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 98.6% 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 ~164 days

Recently: every ~251 days

Total

10

Last Release

2520d ago

Major Versions

v0.1.3 → v1.0.02016-09-22

PHP version history (2 changes)v0.1.0PHP &gt;=5.3.0

v1.0.0PHP &gt;=5.6.0

### Community

Maintainers

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

---

Top Contributors

[![allejo](https://avatars.githubusercontent.com/u/1246453?v=4)](https://github.com/allejo "allejo (145 commits)")[![ryan-hall](https://avatars.githubusercontent.com/u/35271754?v=4)](https://github.com/ryan-hall "ryan-hall (1 commits)")[![shravass](https://avatars.githubusercontent.com/u/28664909?v=4)](https://github.com/shravass "shravass (1 commits)")

---

Tags

api-wrapperphpsocratasocrata-apisocrata-librarysoda

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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