PHPackages                             bizly/airtable-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. bizly/airtable-php

ActiveLibrary[API Development](/categories/api)

bizly/airtable-php
==================

A PHP wrapper for the Airtable API

2.4.7(3y ago)01.1kMITPHPPHP &gt;=5.4

Since Apr 27Pushed 3y agoCompare

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

READMEChangelog (1)Dependencies (1)Versions (16)Used By (0)

Airtable PHP client
===================

[](#airtable-php-client)

A PHP client for the Airtable API. Comments, requests or bug reports are appreciated.

[View examples](examples)

Get started
-----------

[](#get-started)

Please note that Airtable doesn't allow schema manipulation using their public API, you have to create your tables using their interface.

Once you created your base in the Airtable Interface open the API Docs to get your Base ID.

[![API Doc Airtable](examples/img/api-doc-b.png)](examples/img/api-doc-b.png)

The Base ID is a code that starts with 'app' followed by a mix of letter or numbers (appsvqGDFCwLC3I10).

---

### Installation

[](#installation)

If you're using Composer, you can run the following command:

```
composer require sleiman/airtable-php

```

You can also download them directly and extract them to your web directory.

### Add the wrapper to your project

[](#add-the-wrapper-to-your-project)

If you're using Composer, run the autoloader

```
require 'vendor/autoload.php';
```

Or include the Airtable.php file

```
include('../src/Airtable.php');
include('../src/Request.php');
include('../src/Response.php');
```

### Initialize the class

[](#initialize-the-class)

```
use \TANIOS\Airtable\Airtable;
$airtable = new Airtable(array(
    'api_key' => 'API_KEY',
    'base'    => 'BASE_ID'
));
```

### Get all entries in table

[](#get-all-entries-in-table)

We are getting all the entries from the table "Contacts".

```
$request = $airtable->getContent( 'Contacts' );

do {
    $response = $request->getResponse();
    var_dump( $response[ 'records' ] );
}
while( $request = $response->next() );

print_r($request);
```

### Use params to filter, sort, etc

[](#use-params-to-filter-sort-etc)

```
// You don't have to use all the params, they are added as a reference
$params = array(
    "filterByFormula" => "AND( Status = 'New' )",
    "sort" => array(array('field' => 'Count', 'direction' => "desc")),
    "maxRecords" => 175,
    "pageSize" => 50,
    "view" => "Name of your View"
);

$request = $airtable->getContent( 'Contacts', $params);

do {
    $response = $request->getResponse();
    var_dump( $response[ 'records' ] );
}
while( $request = $response->next() );

print_r($request);
```

### Create new entry

[](#create-new-entry)

We will create new entry in the table Contacts

```
// Create an array with all the fields you want
$new_contact_details = array(
    'Name'        =>"Contact Name",
    'Address'     => "1234 Street Name, City, State, Zip, Country",
    'Telephone #' => '123-532-1239',
    'Email'       =>'email@domain.com',
);

// Save to Airtable
$new_contact = $airtable->saveContent( "Contacts", $new_contact_details );

// The ID of the new entry
echo $new_contact->id;

print_r($new_contact);
```

*Batch Create now available, documentation available below*

### Update Contact

[](#update-contact)

Use the entry ID to update the entry

```
$update_contact_details = array(
	'Telephone #' => '514-123-2942',
);
$update_contact = $airtable->updateContent("Contacts/{entry-id}",$update_contact_details);
print_r($update_contact);
```

*Batch Update now available, documentation available below*

### Expended Relationships (eager loading)

[](#expended-relationships-eager-loading)

The response will include all the information of record linked to from another table. In this example, with a single call, the field "Customer Details" will be filled with relations of "Customer Details" table.

When you don't pass an associative array, we assume that the field and the table name are the same.

```
$expended = $airtable->getContent( "Customers/recpJGOaJYB4G36PU", false, [
    'Customer Details'
] );
```

If for some reasons the name of the field differs from the name of the table, you can pass an associative array instead.

```
$expended = $airtable->getContent( "Customers/recpJGOaJYB4G36PU", false, [
    'Field Name' 	        => 'Table Name',
    'Customer Meetings'  => 'Meetings'
] );
```

We heard you like to expend your relationships, so now you can expend your expended relationships. The following is possible.

```
$expend_expended = $airtable->getContent( "Customers/recpJGOaJYB4G36PU", false, [
    'Customer Details',
    'Meetings'      => [
        'table'     => 'Meetings',
        'relations' => [
            'Calendar'  => 'Calendar',
            'Door'      => [
                'table'         => 'Doors',
                'relations'     => [
                    'Added By'  => 'Employees'
                ]
            ]
        ]
    ]
] );
```

But be aware that loading too many relationships can increase the response time considerably.

### Delete entry

[](#delete-entry)

Use the entry ID to delete the entry

```
$delete_contact = $airtable->deleteContent("Contacts/{entry-id}");
```

*Batch Delete now available, documentation available below*

### Quick Check (new)

[](#quick-check-new)

Find a record or many with one line. It's useful when you want to know if a user is already registered or if the same SKU is used. The response will return "count" and "records".

```
$check = $airtable->quickCheck("Contacts",$field,$value);

$check = $airtable->quickCheck("Contacts","Email","jon@wordlco.com");
if($check->count > 0){
    // the value is already there
    var_dump($check->records);
} else {
    // it's not there
}
```

### Batch Create, Update, Delete

[](#batch-create-update-delete)

Airtable API now allows to create, update, and delete 10 records per API request.

Create

```
$content = $a->saveContent( 'Links', [
    [
        'fields'            => [
            'Name'          => 'Tasty'
        ]
    ],
    [
        'fields'            => [
            'Name'          => 'Yolo'
        ]
    ]
] );
```

Update

```
$update = [];

foreach ( $content->records as $record )
{
    $update[] = [
        'id'            => $record->id,
        'fields'        => [
            'Slug'      => strtolower( $record->fields->Name )
        ]
    ];
}

$response = $a->updateContent( 'Links', $update );
```

Delete

```
$delete = [];

foreach ( $response->records as $record )
{
    $delete[] = $record->id;
}

$response = $a->deleteContent( 'Links', $delete );
```

Credits
-------

[](#credits)

Copyright (c) 2019 - Programmed by Sleiman Tanios &amp; Guillaume Laliberté

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 79% 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 ~140 days

Recently: every ~187 days

Total

15

Last Release

1338d ago

PHP version history (3 changes)2.0.1PHP ^5.3.3 || ^7.1

2.2.3PHP &gt;=5.3.3

2.3.0PHP &gt;=5.4

### Community

Maintainers

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

---

Top Contributors

[![sleiman](https://avatars.githubusercontent.com/u/1677407?v=4)](https://github.com/sleiman "sleiman (98 commits)")[![glaliberte](https://avatars.githubusercontent.com/u/1756017?v=4)](https://github.com/glaliberte "glaliberte (24 commits)")[![torrancemiller](https://avatars.githubusercontent.com/u/5090876?v=4)](https://github.com/torrancemiller "torrancemiller (2 commits)")

### Embed Badge

![Health badge](/badges/bizly-airtable-php/health.svg)

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

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

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

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)[hubspot/api-client

Hubspot API client

23414.2M16](/packages/hubspot-api-client)

PHPackages © 2026

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