CodaPHP: A library to easily use Coda API

I created a PHP library that helps using the Coda API in web projects fast and easy.

You can install and use it with composer and it covers all functionalities of the current API version (0.1.1-beta).

You can find it on

Since Coda and the API is in beta, you can also see this library as in beta. Use it on your own risk.

An inspiration what you could do with it:

  • Read data from cells and use it on your site
    (sync your menu for your restaurant website, show/count your current projects, show how many available items are in stock, show office hours, team members…)
  • Fill a table with data
    (create a web form to submit data into coda, count events on your site)
  • Use coda controls to control your website
    (create a ‘mood-slider’ next to your to-do list that shows your motivation and then change the colors/images of your website based on your acutal mood)

A basic example how to get data from a cell:

Click to see the table in Coda


$coda = new CodaPHP('<API TOKEN>'); // Create a new instance
$result = $coda->getRow('<DOC ID>', 'Products', 'Goatmilk'); // Get the row with name 'Goatmilk'
echo $result['values']['Price'];  // Output Price value of this row

This will output 14.9 on the page.

More examples and a documentation to all functions is provided in the readme on Github.

Updates and contribution

First of all thanks to @oleg for your early feedback!

I’ll try to keep the library up to date whenever new API features are released.

If your find bugs, have problems implementing it or if have some suggestions, don’t hesitate to contact me :slight_smile:
Also, it would be cool if you share your results if you implement it somewhere.


Wow this is awesome, nice work @Daniel_Stieber !


This is amazing @Daniel_Stieber. Haven’t touched PHP in ages but will try playing around with your library!


Thanks for your contribution, @Daniel_Stieber! We’d linked to your repository on our API docs under a new “Third-party libraries” section. If anyone else has a library for our API they’d like added there, get in touch. :slight_smile:


Thanks for creating this and sharing @Daniel_Stieber - shared it with the team internally!



Thanks for adding this, I’m trying to use an API for the first time and I’m getting and error.

Fatal error : Uncaught Error: Class ‘CodaPHP’ not found in /Users/juan/Documents/Sites/coda-api/index.php:235 Stack trace: #0 /Users/juan/.composer/vendor/laravel/valet/server.php(158): require() #1 {main} thrown in /Users/juan/Documents/Sites/coda-api/index.php

So far I’ve only installed it through composer and added the following to my index.php file:

require ‘./vendor/autoload.php’; $coda = new CodaPHP(‘<YOUR API TOKEN>’);
// List all your docs
$result = $coda->listDocs(); var_dump($result);

Any ideas what I’m doing wrong?

Hey @Juanmata,
thanks for reaching out. This is actually an error in the documentation, thanks for mentioning that! Have to fix this.

Please use
$coda = new CodaPHP\CodaPHP('<YOUR API TOKEN>');
instead of
$coda = new CodaPHP('<YOUR API TOKEN>');
and let me know how everything works!


1 Like


Hi thanks for that, that now works.

Are you still playing about with this?

Are you able to develop your demo a bit further maybe using a simple form with a submit button?

I’m keen to use my own forms so I can get a simple design layout that matches my site and also having an option to gather the data in an A4 format so I can email / post invoices. I just need a few demo’s to get my started so I can work out how it’s done.

I’m taking it that the API key will also be visible?

When I was looking at APIs when I was using Airtable, I believe they were talking about a proxy to not only hide the API key but also combat Airtable’s five requests per second per base rate limit. Does Coda have a limit like this?


Hey @Juanmata, glad that it works now!

I will enhance CodaPHP when new features in the Coda API will be available or bugs are coming up. Currently it should cover all available API methods.

The API Key is visible to all people who have access to your server. Since PHP is a server-sided programming language, it only passes results to the browser/user, no plain code. So there should not be any way for a website visitor to get your API Key. I guess this is as secure as every “config.php” with mysql login data etc. But yes, everyone with ftp server access can get the API Key and has full access to all your docs, so be careful with it.

Regarding rate limit: The docs say, that there is a “reasonable rate limit”. You can find more about this here.

Do you mean a simple online form that creates rows in a coda table?


1 Like

@Juanmata I built a simple website about FODMAPs here using @Daniel_Stieber’s library. Source is here.

@Daniel_Stieber I’m curious how you sort and filter data once you receive the response? For instance, I wanted to filter the returned rows using the listRows function but couldn’t find the right syntax to use the query parameter from the List rows endpoint in the API. I saw in your documentation for ways to use the query parameter to search docs, but the query parameter in the List rows endpoint needs a key and value. I thought ['query' => array('Food Group' => 'Grains/Starches')] might work in this scenario but it didn’t.


Hey @Al_Chen_Coda,
thanks for pointing that out.

listRows() was not handling the query right!
I fixed that issue in the current development version:
I already tried it with your code, and it worked fine. You can even shorten the array syntax:
$rows = $coda->listRows($docID, $tableID, ['query' => ['Food Group' => 'Grains/Starches']]);
Maybe you can give it a shot.

Before I release 0.0.3 with the fix, I have one question to @oleg or someone of the API team:

Is it possible to add multiple filters in a query in the listRows method and how would a request look like? (like where ab=xy and cd=wy)
I was not able to do it or to find out the right syntax. CodaPHP currently only translates one query, but if the API can do it, I’d like to implement it too.



Thanks @Daniel_Stieber for making the fix!

I’ve released version 0.0.3

The query in “listRows” is now working and I’ve added a short example in the readme under “handling table data”

You can update via composer or get it from

1 Like

@Daniel_Stieber I checked with @oleg and right now the query parameter can only have one filter at the moment :neutral_face:

@Al_Chen_Coda ok thanks for the update!

I guess in most scenarios it would make sense to fetch (and maybe even cache) all rows and filter it down with php locally. so no big deal until there is no “free plan with limited rows” :slight_smile:

1 Like

Thank you so much @Daniel_Stieber for this PHP Library. Used it as a base for a GravityForms addon to push form entries to a specific coda table


Very nice! Love that you were able to use it in a really useful project!

Do you have some feedback on the library? Like, was something not you expected it to be, or do you see the need of some more data formatting options or something?

I’ve realized that the API allows you to duplicate docs as well. This is not implemented yet and will be part of a future update.

thanks @Daniel_Stieber. For this project no. but i am working on another Wordpress plugin which will be more involved.
so far its pretty simple and self explanatory. might have some questions for the next project.

1 Like

Thank you, thank you , thank you! This is exactly what I was looking for. I want to use Coda for our company’s intranet, to include dynamic reporting for our employees and was struggling to find a good solution for building web forms to update a Coda table. Thanks again for putting this together and making it publicly available!


You are very welcome :slight_smile: let me know if something isn‘t working as expected!