<?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: API for events in Madrid and Barcelona</title>
    <description>The latest articles on DEV Community by API for events in Madrid and Barcelona (@dondego).</description>
    <link>https://dev.to/dondego</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.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F12840%2F37d62ad3-34a2-4106-8c8f-f313711c89c0.jpg</url>
      <title>DEV Community: API for events in Madrid and Barcelona</title>
      <link>https://dev.to/dondego</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dondego"/>
    <language>en</language>
    <item>
      <title>We built an API for events, places, and local news in Barcelona and Madrid</title>
      <dc:creator>Alexander Prokofiev</dc:creator>
      <pubDate>Fri, 27 Mar 2026 22:34:02 +0000</pubDate>
      <link>https://dev.to/dondego/we-built-an-api-for-events-places-and-local-news-in-barcelona-and-madrid-1409</link>
      <guid>https://dev.to/dondego/we-built-an-api-for-events-places-and-local-news-in-barcelona-and-madrid-1409</guid>
      <description>&lt;h2&gt;
  
  
  Building a local API for events, places, and news in Barcelona and Madrid &lt;a href="https://github.com/revanbcn/DondeGo-API" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Most city products run into the same problem sooner or later.&lt;/p&gt;

&lt;p&gt;You want to answer simple questions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is happening today?&lt;/li&gt;
&lt;li&gt;What is near these coordinates?&lt;/li&gt;
&lt;li&gt;Which places belong to this category?&lt;/li&gt;
&lt;li&gt;Which local news is still actually relevant?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But once you start building, local data is rarely clean enough. Events, places, and news often live in separate systems, use different filters, and do not map well to the way people actually explore a city.&lt;/p&gt;

&lt;p&gt;That is one of the reasons we started opening up the data layer behind DondeGo.&lt;/p&gt;

&lt;p&gt;DondeGo is a local media and city guide focused on &lt;strong&gt;Barcelona&lt;/strong&gt; and &lt;strong&gt;Madrid&lt;/strong&gt;. The editorial side is built around practical discovery: things to do, places to know, and local news that matters in city life. Recently, we have been turning more of that into an API that can be reused in real products.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the API is trying to solve
&lt;/h2&gt;

&lt;p&gt;The goal is not to build a huge generic directory.&lt;/p&gt;

&lt;p&gt;The goal is to make local urban content easier to work with for developers, editorial teams, maps, newsletters, recommendation tools, and city-focused products.&lt;/p&gt;

&lt;p&gt;Right now the API is centered around three main object types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;events&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;places&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;news&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That makes it possible to support workflows like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;showing events happening today in Madrid&lt;/li&gt;
&lt;li&gt;finding places within a radius from a point on the map&lt;/li&gt;
&lt;li&gt;filtering objects by tags or categories&lt;/li&gt;
&lt;li&gt;returning only current news items&lt;/li&gt;
&lt;li&gt;building city guides or local recommendation layers&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Recent changes in v0.1.0
&lt;/h2&gt;

&lt;p&gt;We have just published &lt;strong&gt;v0.1.0&lt;/strong&gt;, partly because I wanted the project to have a visible public milestone and partly because the API has become much more usable recently.&lt;/p&gt;

&lt;p&gt;A few of the changes included in this version:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;daily events now also include films&lt;/li&gt;
&lt;li&gt;daily events can now return a title override&lt;/li&gt;
&lt;li&gt;event and place categories now expose identifiers&lt;/li&gt;
&lt;li&gt;filtering by tag slugs is supported via &lt;code&gt;tags&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;news now supports an &lt;code&gt;actual_only&lt;/code&gt; filter for current items&lt;/li&gt;
&lt;li&gt;event date serialization now includes:

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;start_date&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;start_time&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;end_date&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;end_time&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;is_continuous&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;is_endless&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;is_startless&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;schedules&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;image serialization now includes authorship&lt;/li&gt;

&lt;li&gt;it is now possible to fetch only films with free screenings&lt;/li&gt;

&lt;li&gt;it is now possible to fetch only places with free events&lt;/li&gt;

&lt;li&gt;
&lt;code&gt;is_free&lt;/code&gt; is now interpreted more strictly&lt;/li&gt;

&lt;li&gt;categories for events and places can now be disabled in collection responses&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;None of this is especially flashy, but it moves the API closer to being something that is genuinely usable in production.&lt;/p&gt;

&lt;h2&gt;
  
  
  The kind of queries we care about
&lt;/h2&gt;

&lt;p&gt;The API is most useful when it reflects how people actually navigate a city.&lt;/p&gt;

&lt;p&gt;For example, a basic daily query:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;GET /api/v1/events/?location=madrid&amp;amp;date=hoy
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A proximity-based query:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;GET /api/v1/events/?lat=40.4168&amp;amp;lon=-3.7038&amp;amp;radius=3000&amp;amp;date=hoy
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And place discovery around a point:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;GET /api/v1/places/?lat=41.3874&amp;amp;lon=2.1686&amp;amp;radius=2000
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That may sound simple, but in practice this is the layer many local products need most.&lt;/p&gt;

&lt;p&gt;Not “all possible city data”, but structured answers to questions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what can I do today?&lt;/li&gt;
&lt;li&gt;what is nearby?&lt;/li&gt;
&lt;li&gt;what is free?&lt;/li&gt;
&lt;li&gt;what is still current?&lt;/li&gt;
&lt;li&gt;what belongs to this area or category?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why I find local APIs interesting
&lt;/h2&gt;

&lt;p&gt;There are many great APIs in the world, but local discovery still feels oddly underserved.&lt;/p&gt;

&lt;p&gt;A lot of the difficulty is not in storing records. It is in making the data useful in the context of a real city. Dates matter. Geography matters. Editorial freshness matters. Category structure matters. Free vs paid matters. Sometimes a simple “today” filter matters more than a complex taxonomy.&lt;/p&gt;

&lt;p&gt;That is why I think local APIs are interesting. They sit somewhere between media, maps, structured data, and product design.&lt;/p&gt;

&lt;h2&gt;
  
  
  If you are building in this space
&lt;/h2&gt;

&lt;p&gt;We are opening access gradually, but if you are working on a project around Barcelona or Madrid and need local events, places, or news, that is what we are building toward.&lt;/p&gt;

&lt;p&gt;The public project is here, a bit more context lives there: &lt;a href="https://dondego.es/" rel="noopener noreferrer"&gt;DondeGo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I would also be curious how other people here would design this kind of API.&lt;/p&gt;

&lt;p&gt;Would you prioritize geospatial search first, editorial freshness first, or category and tag structure first?&lt;/p&gt;

</description>
      <category>api</category>
      <category>barcelona</category>
      <category>madrid</category>
      <category>opendata</category>
    </item>
  </channel>
</rss>
