<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Api-Client on Buro notes</title><link>https://notes.burelli.xyz/tags/api-client/</link><description>Recent content in Api-Client on Buro notes</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 25 Oct 2026 15:05:08 +0100</lastBuildDate><atom:link href="https://notes.burelli.xyz/tags/api-client/index.xml" rel="self" type="application/rss+xml"/><item><title>How I write a client for an external API in Elixir</title><link>https://notes.burelli.xyz/posts/engineering/elixir/external-api-client/</link><pubDate>Sun, 25 Oct 2026 14:34:31 +0100</pubDate><guid>https://notes.burelli.xyz/posts/engineering/elixir/external-api-client/</guid><description>&lt;h1 id="how-i-write-a-client-for-an-external-api-in-elixir"&gt;How I write a client for an external API in Elixir&lt;/h1&gt;&#10;&lt;p&gt;The pattern I use for every external API (Stripe, Shopify, &amp;hellip;): one module per API, a root &lt;code&gt;Api&lt;/code&gt; module with the shared utilities, a test fixture with its mocks.&lt;/p&gt;&#10;&lt;h2 id="the-api-module"&gt;The Api module&lt;/h2&gt;&#10;&lt;p&gt;One module per API, inside the folder of its feature or context: &lt;code&gt;Feature.Api&lt;/code&gt;, or &lt;code&gt;Feature.&amp;lt;Name&amp;gt;Api&lt;/code&gt; when a service has more than one API.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;code&gt;Stripe.Api&lt;/code&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;code&gt;Shopify.AdminApi&lt;/code&gt;, &lt;code&gt;Shopify.PartnerApi&lt;/code&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h3 id="get_req0"&gt;&lt;code&gt;get_req/0&lt;/code&gt;&lt;/h3&gt;&#10;&lt;p&gt;Builds the &lt;code&gt;Req&lt;/code&gt; for this API: base URL, credentials and options from the application config.&lt;/p&gt;</description></item></channel></rss>