Show HN: Sequin – Use Postgres/SQL to read from and write to APIs
Hi HN community,<p>I&#x27;m Anthony, co-founder of Sequin (sequin.io), and am excited to show you what we&#x27;ve been working on. Sequin lets you skip HTTP APIs and integrate with Postgres and SQL instead.<p>While we originally launched with a one-way sync from APIs to Postgres, as of today, you can now _write back_ to APIs using `insert`, `update`, and `delete` on your synced tables.<p>We built Sequin because no one is happy with HTTP APIs today.<p>For developers that need to build on top of third-party APIs, each integration is bespoke. There are few standards. I&#x27;ve personally seen over a dozen different OAuth 2.0 implementations, every JSON response format imaginably, and countless strategies for pagination. On top of that, poor throughput and&#x2F;or rate limits mean every integration I&#x27;ve worked on has needed to cache or sync data.<p>The platforms that provide HTTP APIs for consumers are equally unhappy. There are few standards that the industry adheres to, resulting in a process that is full of bike-shedding. And when it&#x27;s finished, it&#x27;s always disappointing, as even the best HTTP APIs are full of compromises and struggle to service the long-tail of use cases. This leads to frustration on both sides.<p>At Sequin, we&#x27;re building a platform that consists of two novel features that make both API consumers and providers much happier.<p>The first is the feature we originally launched with: *we sync data from the API provider in real-time and put it in a Postgres database*. By extracting data out of the API and putting it in Postgres, consumers enjoy a number of benefits:<p>1. They can read their data without throughput limits, such as those imposed by rate limits.<p>2. They can query their data with all the expressiveness of SQL. SQL is an order of magnitude more expressive than the typical HTTP API.<p>3. They can use a standard interface they&#x27;re familiar with (SQL) vs a bespoke one. In fact, they can just use their ORM to integrate, vs needing to use an under-supported API adapter library.<p>We&#x27;re launching our second innovation today: Developers can now write _back_ to the API via Sequin. *We intercept the mutations that you make to synced records in your database and apply them to the API as well*.<p>In fact, our Postgres Proxy commits the write to the API _first_, before your database.  This means that all the necessary policy that the API implements – like validation rules – are run against every database write. The API remains the source of truth, and the database never drifts.<p>If the write fails API validation, the Proxy rolls the write back and returns a native Postgres error:<p>```<p>insert into salesforce.contact (first_name, last_name, email)<p>values (&#x27;Andrea&#x27;,&#x27;Palladio&#x27;,&#x27;andrea__invalid&#x27;)
returning id;<p>ERROR: [Salesforce]: Property values were not valid: `email` &#x27;andrea_invalid&#x27; is invalid.<p>```<p>With these two components of our platform, APIs interfaces are no longer bespoke, they&#x27;re familiar. We abstract away the common cruft of integrations, like syncing, cache invalidation, normalization, rate limit management, and token management. We let developers instead just focus on crafting the reads and writes that their application needs.<p>You get to have the tables from the APIs across your stack right there in your database, fully readable and writeable.<p>We only support three platforms today: Salesforce, HubSpot, and Airtable. We work hard to make the experience as seamless as possible, which takes a little time to build – but more platforms are on the way.<p>One more thing: You don&#x27;t need Postgres in your stack to use Sequin! We offer hosted databases that can serve as your API interface.<p>Check out our docs to learn more. [0] Or, give it a spin for yourself. [1]<p>If there&#x27;s an integration you&#x27;d love to see supported or you have any questions&#x2F;thoughts, let me know below!<p>https:&#x2F;&#x2F;sequin.io<p>[0] https:&#x2F;&#x2F;docs.sequin.io
[1] https:&#x2F;&#x2F;app.sequin.io