<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sergio Coitiño</title>
    <description>The latest articles on DEV Community by Sergio Coitiño (@sergiocoitino).</description>
    <link>https://dev.to/sergiocoitino</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4214981%2F0e92bc36-03d7-45c1-a155-f2ed7045f42e.jpg</url>
      <title>DEV Community: Sergio Coitiño</title>
      <link>https://dev.to/sergiocoitino</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sergiocoitino"/>
    <language>en</language>
    <item>
      <title>Free images for SWAPI (The Star Wars API) — no API key, CORS enabled</title>
      <dc:creator>Sergio Coitiño</dc:creator>
      <pubDate>Thu, 29 Oct 2026 17:00:32 +0000</pubDate>
      <link>https://dev.to/sergiocoitino/free-images-for-swapi-the-star-wars-api-no-api-key-cors-enabled-3873</link>
      <guid>https://dev.to/sergiocoitino/free-images-for-swapi-the-star-wars-api-no-api-key-cors-enabled-3873</guid>
      <description>&lt;p&gt;SWAPI (The Star Wars API) is one of the most popular free APIs for learning REST APIs in React, Vue, or vanilla JS — but it only returns JSON text. There are no images for Luke Skywalker, Tatooine, or the Millennium Falcon.&lt;/p&gt;

&lt;p&gt;Furthermore, the old image host frequently used in tutorials (starwars-visualguide.com) currently has broken SSL certificates, failing to load across modern browsers.&lt;/p&gt;

&lt;p&gt;To solve this, I created a free static image API where every image matches the exact same ID used by SWAPI:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://starwarsgallery.netlify.app/assets/%7Bcategory%7D/%7Bid%7D.jpg" rel="noopener noreferrer"&gt;https://starwarsgallery.netlify.app/assets/{category}/{id}.jpg&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It covers 238 images across 5 categories: people, planets, species, starships, and vehicles.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Use It (JavaScript)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
javascript
const getSwapiImage = (category, swapiUrl) =&amp;gt; {
  const id = swapiUrl.split('/').filter(Boolean).pop();
  return `https://starwarsgallery.netlify.app/assets/${category}/${id}.jpg`;
};

// Fetch data from SWAPI
const res = await fetch('https://swapi.dev/api/people/1/');
const luke = await res.json();

// Get the matching image
const imageUrl = getSwapiImage('people', luke.url);
console.log(imageUrl); 
// Output: "https://starwarsgallery.netlify.app/assets/people/1.jpg"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>api</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
