{"id":40421266,"url":"https://github.com/sleiman/airtable-php","last_synced_at":"2026-01-20T15:08:27.432Z","repository":{"id":51613437,"uuid":"82454499","full_name":"sleiman/airtable-php","owner":"sleiman","description":"A PHP client for the Airtable API","archived":false,"fork":false,"pushed_at":"2024-02-22T13:47:31.000Z","size":147,"stargazers_count":161,"open_issues_count":12,"forks_count":30,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-08-17T15:52:57.272Z","etag":null,"topics":["airtable","php","wrapper"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sleiman.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-19T11:33:51.000Z","updated_at":"2025-07-16T12:36:23.000Z","dependencies_parsed_at":"2024-06-18T14:07:03.668Z","dependency_job_id":null,"html_url":"https://github.com/sleiman/airtable-php","commit_stats":{"total_commits":110,"total_committers":4,"mean_commits":27.5,"dds":"0.23636363636363633","last_synced_commit":"21cc4d887e2a7660260bb769b9711eb36b946aed"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/sleiman/airtable-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sleiman%2Fairtable-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sleiman%2Fairtable-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sleiman%2Fairtable-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sleiman%2Fairtable-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sleiman","download_url":"https://codeload.github.com/sleiman/airtable-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sleiman%2Fairtable-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28606139,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T14:45:23.139Z","status":"ssl_error","status_checked_at":"2026-01-20T14:44:16.929Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["airtable","php","wrapper"],"created_at":"2026-01-20T15:08:27.306Z","updated_at":"2026-01-20T15:08:27.424Z","avatar_url":"https://github.com/sleiman.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Airtable PHP client\nA PHP client for the Airtable API. \nComments, requests or bug reports are appreciated.\n\n[View examples](examples)\n\n## Get started\n\nPlease note that Airtable doesn't allow schema manipulation using their public API, you have to create your tables using their interface.\n\nOnce you created your base in the Airtable Interface open the API Docs to get your Base ID.\n\n\n\u003cimg src=\"examples/img/api-doc-b.png\" alt=\"API Doc Airtable\"  width=\"200\"\u003e\n\nThe Base ID is a code that starts with 'app' followed by a mix of letter or numbers (appsvqGDFCwLC3I10).\n\n---\n\n### Installation\n\nIf you're using Composer, you can run the following command:\n```\ncomposer require sleiman/airtable-php\n```\nYou can also download them directly and extract them to your web directory.\n\n\n### Add the wrapper to your project\nIf you're using Composer, run the autoloader\n```php\nrequire 'vendor/autoload.php';\n```\nOr include the Airtable.php file\n\n```php\ninclude('../src/Airtable.php');\ninclude('../src/Request.php');\ninclude('../src/Response.php');\n```\n### Initialize the class\n```php\nuse \\TANIOS\\Airtable\\Airtable;\n$airtable = new Airtable(array(\n    'api_key' =\u003e 'API_KEY',\n    'base'    =\u003e 'BASE_ID'\n));\n```\n### Get all entries in table\nWe are getting all the entries from the table \"Contacts\". \n```php\n$request = $airtable-\u003egetContent( 'Contacts' );\n\ndo {\n    $response = $request-\u003egetResponse();\n    var_dump( $response[ 'records' ] );\n}\nwhile( $request = $response-\u003enext() );\n\nprint_r($request);\n```\n### Use params to filter, sort, etc\n```php\n// You don't have to use all the params, they are added as a reference\n$params = array(\n    \"filterByFormula\" =\u003e \"AND( Status = 'New' )\",\n    \"sort\" =\u003e array(array('field' =\u003e 'Count', 'direction' =\u003e \"desc\")),\n    \"maxRecords\" =\u003e 175,\n    \"pageSize\" =\u003e 50,\n    \"view\" =\u003e \"Name of your View\"\n);\n\n$request = $airtable-\u003egetContent( 'Contacts', $params);\n\ndo {\n    $response = $request-\u003egetResponse();\n    var_dump( $response[ 'records' ] );\n}\nwhile( $request = $response-\u003enext() );\n\nprint_r($request);\n```\n### Create new entry\nWe will create new entry in the table Contacts\n```php\n// Create an array with all the fields you want \n$new_contact_details = array(\n    'Name'        =\u003e\"Contact Name\",\n    'Address'     =\u003e \"1234 Street Name, City, State, Zip, Country\",\n    'Telephone #' =\u003e '123-532-1239',\n    'Email'       =\u003e'email@domain.com',\n);\n\n// Save to Airtable\n$new_contact = $airtable-\u003esaveContent( \"Contacts\", $new_contact_details );\n\n// The ID of the new entry\necho $new_contact-\u003eid;\n\nprint_r($new_contact);\n```\n*Batch Create now available, documentation available below*\n\n### Update Contact\nUse the entry ID to update the entry\n```php\n$update_contact_details = array(\n\t'Telephone #' =\u003e '514-123-2942',\n);\n$update_contact = $airtable-\u003eupdateContent(\"Contacts/{entry-id}\",$update_contact_details);\nprint_r($update_contact);\n```\n*Batch Update now available, documentation available below*\n\n### Expended Relationships (eager loading)\nThe response will include all the information of record linked to from another table.\nIn this example, with a single call, the field \"Customer Details\" will be filled with relations of \"Customer Details\" table.\n\nWhen you don't pass an associative array, we assume that the field and the table name are the same.\n```php\n$expended = $airtable-\u003egetContent( \"Customers/recpJGOaJYB4G36PU\", false, [\n    'Customer Details'\n] );\n```\n\nIf for some reasons the name of the field differs from the name of the table, you can pass an associative array instead.\n```php\n$expended = $airtable-\u003egetContent( \"Customers/recpJGOaJYB4G36PU\", false, [\n    'Field Name' \t        =\u003e 'Table Name',\n    'Customer Meetings'  =\u003e 'Meetings'\n] );\n```\n\nWe heard you like to expend your relationships, so now you can expend your expended relationships.\nThe following is possible.\n```php\n$expend_expended = $airtable-\u003egetContent( \"Customers/recpJGOaJYB4G36PU\", false, [\n    'Customer Details',\n    'Meetings'      =\u003e [\n        'table'     =\u003e 'Meetings',\n        'relations' =\u003e [\n            'Calendar'  =\u003e 'Calendar',\n            'Door'      =\u003e [\n                'table'         =\u003e 'Doors',\n                'relations'     =\u003e [\n                    'Added By'  =\u003e 'Employees'\n                ]\n            ]\n        ]\n    ]\n] );\n```\n\nBut be aware that loading too many relationships can increase the response time considerably.\n\n### Delete entry\nUse the entry ID to delete the entry\n```php\n$delete_contact = $airtable-\u003edeleteContent(\"Contacts/{entry-id}\");\n```\n*Batch Delete now available, documentation available below*\n\n### Quick Check (new)\nFind 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.\nThe response will return \"count\" and \"records\".\n```php\n$check = $airtable-\u003equickCheck(\"Contacts\",$field,$value);\n\n$check = $airtable-\u003equickCheck(\"Contacts\",\"Email\",\"jon@wordlco.com\");\nif($check-\u003ecount \u003e 0){\n    // the value is already there\n    var_dump($check-\u003erecords);\n} else {\n    // it's not there\n}\n```\n\n### Batch Create, Update, Delete\nAirtable API now allows to create, update, and delete 10 records per API request.\n\nCreate\n```php\n$content = $a-\u003esaveContent( 'Links', [\n    [\n        'fields'            =\u003e [\n            'Name'          =\u003e 'Tasty'\n        ]\n    ],\n    [\n        'fields'            =\u003e [\n            'Name'          =\u003e 'Yolo'\n        ]\n    ]\n] );\n```\n\nUpdate\n```php\n$update = [];\n\nforeach ( $content-\u003erecords as $record )\n{\n    $update[] = [\n        'id'            =\u003e $record-\u003eid,\n        'fields'        =\u003e [\n            'Slug'      =\u003e strtolower( $record-\u003efields-\u003eName )\n        ]\n    ];\n}\n\n$response = $a-\u003eupdateContent( 'Links', $update );\n```\n\nDelete\n```php\n$delete = [];\n\nforeach ( $response-\u003erecords as $record )\n{\n    $delete[] = $record-\u003eid;\n}\n\n$response = $a-\u003edeleteContent( 'Links', $delete );\n```\n\n## Credits\n\nCopyright (c) 2019 - Programmed by Sleiman Tanios \u0026 Guillaume Laliberté\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsleiman%2Fairtable-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsleiman%2Fairtable-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsleiman%2Fairtable-php/lists"}