{"id":18720747,"url":"https://github.com/lee-to/php-airtable","last_synced_at":"2025-04-12T14:24:58.010Z","repository":{"id":62516680,"uuid":"277802129","full_name":"lee-to/php-airtable","owner":"lee-to","description":"AirTable API client for PHP","archived":false,"fork":false,"pushed_at":"2020-08-04T12:43:38.000Z","size":35,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T09:01:44.170Z","etag":null,"topics":["airtable","airtable-api","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lee-to.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-07T11:49:46.000Z","updated_at":"2023-11-22T21:30:39.000Z","dependencies_parsed_at":"2022-11-02T13:45:24.171Z","dependency_job_id":null,"html_url":"https://github.com/lee-to/php-airtable","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lee-to%2Fphp-airtable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lee-to%2Fphp-airtable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lee-to%2Fphp-airtable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lee-to%2Fphp-airtable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lee-to","download_url":"https://codeload.github.com/lee-to/php-airtable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248579215,"owners_count":21127777,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","airtable-api","php"],"created_at":"2024-11-07T13:32:27.138Z","updated_at":"2025-04-12T14:24:57.990Z","avatar_url":"https://github.com/lee-to.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AirTable API client for PHP\n\n[![Build Status](https://img.shields.io/travis/lee-to/php-airtabl/5.x.svg)](https://travis-ci.org/github/lee-to/php-airtable)\n[![Total Downloads](https://poser.pugx.org/lee-to/php-airtable/downloads)](//packagist.org/packages/lee-to/php-airtable)\n[![License](https://poser.pugx.org/lee-to/php-airtable/license)](//packagist.org/packages/lee-to/php-airtable)\n\nAirTable API client for PHP\n\n## Installation\n\nThe AirTable Client PHP can be installed with [Composer](https://getcomposer.org/). Run this command:\n\n```sh\ncomposer require lee-to/php-airtable\n```\n\n## Usage\n\nGet token and base from [AirTable Account](http://airtable.com/account) and [AirTable API](http://airtable.com/api)\n\n### Import.\n```php\nuse Airtable;\n```\n\n### Init.\n- optional param $http_client = \"curl\" or \"guzzle\". Default guzzle if exist or curl\n\n```php\n\n$client = new AirTable($token, $base, $http_client);\n```\n\n#### Get records from that table\n- List table records\n\n``` php\n$client-\u003etable('table_name')-\u003elist();\n```\n\n#### Get one record from table.\n``` php\n$client-\u003etable('table_name')-\u003eretrieve('ID');\n```\n\n#### Filter records\n- First argument is the column name\n- Second argument is the operator or the value if you want to use equal '=' as an operator.\n- Third argument is the value of the filter\n``` php\n$client-\u003etable('table_name')-\u003efilterByFormula(\"column\", \"operator\", \"value\")-\u003elist();\n```\n\n#### Sort records\n- First argument is the column name\n- Second argument is direction.\n\n``` php\n$client-\u003etable('table_name')-\u003esort(\"column\", \"direction\")-\u003elist();\n```\n\n#### Fields\n- Only data for fields whose names are in this list will be included in the result. If you don't need every field, you can use this parameter to reduce the amount of data transferred\n\n``` php\n$client-\u003etable('table_name')-\u003efields([\"Column1\", \"Column2\"])-\u003elist();\n```\n\n#### Max records \n- The maximum total number of records that will be returned in your requests. If this value is larger than pageSize (which is 100 by default), you may have to load multiple pages to reach this total.\n\n``` php\n$client-\u003etable('table_name')-\u003emaxRecords(15)-\u003elist();\n```\n\n#### Page size \n- The number of records returned in each request. Must be less than or equal to 100. Default is 100.\n\n``` php\n$client-\u003etable('table_name')-\u003epageSize(15)-\u003elist();\n```\n\n#### Offset \n- Set offset ID for next page\n\n``` php\n$client-\u003etable('table_name')-\u003eoffset('ID')-\u003elist();\n```\n\n#### Update \n- Update one record\n\n``` php\n$client-\u003etable('table_name')-\u003eupdate('ID', [\"Column1\" =\u003e \"Value\"]);\n```\n\nOR \n\n``` php\nforeach($client-\u003etable('table_name')-\u003elist() as $record) {\n    $record-\u003eupdate([\"Column1\" =\u003e \"Value\"]);\n}\n```\n\n#### Create\n- Create a new record\n\n``` php\n$client-\u003etable('table_name')-\u003ecreate([\"Column1\" =\u003e \"Value\"]);\n```\n#### Delete\n- Delete one record\n\n``` php\n$client-\u003etable('table_name')-\u003edelete('ID');\n```\n\nOR \n\n``` php\nforeach($client-\u003etable('table_name')-\u003elist() as $record) {\n    $deleted = $record-\u003edelete();\n    \n    $deleted-\u003eisDeleted(); // Check is deleted or not\n}\n```\n\n#### Get fields of record\n\n``` php\nforeach($client-\u003etable('table_name')-\u003elist() as $record) {\n    $record-\u003egetId(); // ID \n    \n    $record-\u003eCOLUMN1; // Any fields in table \n}\n```\n\n## Tests\n\n1. [Composer](https://getcomposer.org/) is a prerequisite for running the tests. Install composer globally, then run `composer install` to install required files.\n2. Get personal API key and Base [AirTable](https://airtable.com/account), then create `tests/AirTableTestCredentials.php` from `tests/AirTableTestCredentials.php.dist` and edit it to add your credentials.\n3. The tests can be executed by running this command from the root directory:\n\n```bash\n$ ./vendor/bin/phpunit\n```\n\n## See also\n\n- [Laravel Airtable] (https://github.com/lee-to/laravel-airtable)\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Credits\n\n- [Danil Shutsky](https://github.com/lee-to)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n## Security\n\nIf you have found a security issue, please contact the maintainers directly at [leetodev@ya.ru](mailto:leetodev@ya.ru).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flee-to%2Fphp-airtable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flee-to%2Fphp-airtable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flee-to%2Fphp-airtable/lists"}