A row of bicycles parked on the side of a street.

APIs and the Smart City

Exploring the role of APIs in enabling smart city initiatives

As cities grow and evolve, so do the issues that local governments need to address. Leveraging technology to provide public services more efficiently and intelligently is one approach that dozens of cities across the globe are doing. Examples include everything from connected streetlights to full-service apps that help citizens report on a myriad of issues including potholes and graffiti. The common enabler of these programs, are APIs. This post explores various smart city projects, the APIs involved, and how needs shift as cities mature.

Do I live in a smart city? It’s not the first descriptor I think of regarding Vancouver. Expensive: yes. Beautiful: absolutely. But smart? I asked my partner if he could describe a smart city. After a long pause … he came up with: “smart … traffic lights? I honestly don’t know.â€

My interest in this topic was sparked last summer when prompted to download our city’s app to report on a cracked manhole cover that was tripping pedestrians up on a busy downtown sidewalk. Amazingly, it was fixed within hours. Months later – using that same app – I “adopted” four catch basins near our apartment, bought a little rake, and tracked the times I cleared leaves to help the city prevent roads from flooding. And of course being part of the Academy always has me thinking about the buzz of API activity that helps fuel these interactions. But does a simple app make Vancouver smart? What is a smart city?

Definitions of a smart city will depend on whom you ask … and they may not even think of their city as ‘smart’ — just a place they want to live in, work in, and be a part of.

– Benson Chan, Network World, March 2018

While there is no agreed upon definition of a smart city, many share these common characteristics:

  • Dozens, if not hundreds, of free wifi hotspots
  • Sensors to aid in the smooth flow of traffic (vehicle, bike, pedestrian)
  • Sensors in trash cans that ping when they are close to full or overflowing
  • Lampposts that brighten when pedestrians are near, some performing triple-duty as wifi hotspots and air quality sensors
  • Parking stall sensors providing real-time availability of spots

Which cities lead the way?

The names change over the years, but Barcelona was one of the first locations to implement smart city initiatives. It continues to evolve and hosts the annual smart city expo. In addition to all the features listed above, Barcelona’s flagship initiative is its SENTILO platform that monitors nearly 20,000 sensors placed around the city, including park sprinklers fitted with temperature, moisture, and humidity readers. The data these sensors provide and the decisions made based on that data has saved the city millions, because they’re only watering gardens when they need to, where they need to. Other European cities with mature digital infrastructure include Amsterdam, Zurich, and Vienna.

In the US, New York City, Boston, and Chicago were some of the first to implement their smart city initiatives in 2011 and 2012. Chicago even uses GPS sensors on snow plows that feed into a realtime plow tracker map that everyone can access. Now, nearly 200 cities around the globe have invested in technology infrastructure to increase efficiency and civic engagement.

The role of APIs in the Smart City

Many years ago I was part of a corporate training team that wanted to create a mobile app for learners. It was the first time I had ever heard about APIs, and I quickly learned that they were a critical component of the app. Without them, it just wouldn’t work. Like a toy without a battery, our app wouldn’t actually do anything without several APIs baked into the project.

APIs are the workhorses behind all the technology we interact with. They are the snippets of code that ferry requests and responses over the internet (http:). One way I often describe APIs is in relation to the spinning wheel in the top bar of my phone when I am using various apps. During those milliseconds when it appears is an indicator that APIs are at work, using lightweight protocols to send whatever you asked for: what is today’s weather? to the place that contains that info, and returning the answer to you. And just like our corporate learning app relied on APIs to fly, so do smart city initiatives.

For every item on a smart city’s wish list, a small army of APIs will be needed for it to be fulfilled. They are the essential ingredients in making this network of connected devices communicate with one another. And building this functionality and securing it properly takes the right tools, and time. For most city IT departments, it’s likely that their technical infrastructure is a spaghetti bowl of legacy architecture with various public/private partnerships utilizing systems that may not talk well with each other. Indeed:

The greatest challenge facing aspiring smart cities is that so much of the data is in silos, walling off collaboration.

– Jennifer Riggins, Nordic APIs, 2015

Many projects often involve partnerships between the private and public sector, and between parties that don’t often interact. The ecosystems involved need to have a standardized way to integrate and communicate, and they do this using APIs. If one legacy system of record doesn’t communicate well with another, an API can act as the conduit to enable that transfer of information.

A great example of APIs integrating siloed systems can be experienced in Zaragoza, Spain. It’s Citizen Card can get you on free city-wide wifi, check a book out of the library, unlock a bike share, and pay for your bus ride home. Talk about a symphony of integration! In order to get all of these historically separate functions to work together, APIs provide the handshakes.

Another way to encourage collaboration is through leveraging an API known as Open311. Open311 is a data format, or open standard for civic issue tracking that helps municipalities with disparate ways of publishing data to speak a common language. This allows that data to be easily shared between providers. It helps standardize the way service requests are submitted to a city’s system of record. An example of a city using this standard is Vancouver, detailed below.

Smart Vancouver

In 2013, Vancouver published a comprehensive digital strategy, the first city in Canada to do so. Jessie Adcock, now the city of Vancouver’s Chief Technical Officer, was at the helm of this initiative. Among its focuses were:

  • Enhancing connectivity
  • Enhance digital infrastructure and assets

While writing this post, I was put in touch with Tadhq Healy, who kindly answered my questions about Vancouver’s digital strategy. We talked about our shared affections for this city, its digital strategy, and what’s coming up next.

VanConnect, our city’s app, launched in 2014. It’s what I used when reporting that cracked manhole cover. The app has proven popular for civic engagement, allowing users to easily upload and submit photos reporting an array of unsightly things like abandoned mattresses, garbage, potholes, and graffiti. It also supports geotagging, and a typical day of requests is shown in the image below. The Open311 API supports multiple languages and file types, including submissions from different types of phones and images. This also provides a trove of data with which the city can make intelligent decisions. Before this app I really had no appreciation for the number of mattresses left in alleyways! But what I love about this tool is that it provides a way for citizens to easily engage with and receive feedback from their governments, however small the issues are.

A typical day of requests in the VanConnect app

Now that the city of Vancouver’s initial goals from the 2013 digital strategy have been met, they’re shifting their focus to interoperability, greater efficiencies, data privacy, and funding for more projects.

As Smart Cities Evolve

As cities like Barcelona, New York, and Vancouver look ahead, there’s a shift in both their approach and to how citizen data is being collected, stored, and used. Pervasive data collection is a privacy concern, and citizens want to make sure their data is being used for the right reasons. More importantly, they want to ensure that their city government technology reflects and serves its people.

In Barcelona, mayor Ada Colau has called for a democratic revolution to encourage civic engagement by providing a platform which allows citizens to propose changes they care about. To date over 40,000 proposals have been received. And in today’s Barcelona – the changes they want are largely centered around affordable housing, energy transition, air quality, and public spaces.

New York recently filled a newly created position of Chief Privacy Officer, tasked with enhancing responsible citywide data-sharing practices and continuing to improve how the city uses data to inform responsible and equitable policies.

The trend continues — in July 2018, a conference hosted by Fearless Cities will encourage discussion and action around their vision for bottom-up, community-controlled public infrastructure that puts power into the hands of the people who live and work in those communities.

The livable city

Do I live in a smart city? Yes, we have digital conveniences. But they’re not necessarily making our city more livable, as we have other more pressing issues to contend with. That said, I can appreciate that municipal level digital transformation isn’t tasked with solving all social and political struggles. That said, leveraging technology and APIs to operate more efficiently is a smart decision. Providing innovative digital solutions to help its citizens conduct business and leisure activities is smart. But like any new technology, we need to be mindful of its use and ensure that it’s for the betterment of the people who use it.

To read more about how APIs take smart cities from concept to value, download this whitepaper.