How Smart Cities Are Promoting API Usage

APIs are increasingly being released by city authorities around the world as a programmatic way for community organizations and businesses to interact with city open data. Cities are running hackathons or civic hacking events to encourage reuse of city datasets. APIs are discussed in terms of their benefits to civic engagement through greater transparency, for more efficient delivery of government services, and as an enabler of a new wave of local industry innovation. The growing international focus on the “smart city” — in which open data, e-government, and real-time sensor feeds contribute to more automated and sustainable city functioning — will also rely heavily on APIs in order to make much of that agenda possible.

But the truth is, cities around the world are only starting on the API journey. Many have commenced with open data portals that were published with an ad-hoc collection of historical data released, and then left to stagnate as uptake was limited. Others focused on civic hacking events that gave rise to sporadic events that built some app prototypes and not much more. Few cities are focused on creating transactional APIs that would enable citizens and local businesses to engage with services directly via API, with perhaps Open 311 being the only example of civic engagement and service delivery provided via API. While there are many successes across the globe, there is also much more work to do.

Here is a look at four city examples from around the globe. We look at some of the key trends demonstrated by these case studies, and highlight the progress that is emerging and the challenges ahead.

Barcelona

Barcelona continues to win international awards as one of the most innovative smart cities in the world. Some of their recent acclaimed projects include:

  • A CityOS project that enables tech makers and devs to prototype sensor and API-enabled projects using an area of the city as an experimental lab
  • The business incubator BDigital program for apps development 
  • New models of procurement for city services, like Citymart (which posts a city’s urban problems, and then facilitates submissions from businesses who are encouraged to create innovative solutions, rather than the usual city tendering process where the city completely defines the service they want to contract in advance).

ABOVE: Some of the smart city awards won by Barcelona City

APIs are published across various government departments, including:

  • Area Metroplitana de Barcelona: a collection of agencies that publish transport, environment, land use, and business data. API documentation is published in Catalan and includes datasets of publications, city news, research study results (on transport, the environment, etc.), current projects and works, urban plans, and datasets that outline city infrastructure and resources (beach locations, bus stops, taxis, business services, etc.). Documentation is a webpage explaining the various query parameters, etc., that can be made, with links to the available JSON datasets. An API key is not necessary to make the calls.
  • Sentilo: Sentilo is Barcelona city’s open source, Internet of Things (IoT) smart city infrastructure platform aimed at enabling access to sensor and actuator data (monitoring temperature and air quality, garbage collection, parking, pedestrian flows, etc.). A REST API provides access to the city’s sensors and actuators. Documentation includes example code snippets and an active Google Groups forum is used to respond to developer issues.
  • Open Data BCN: An open data catalog publishes 118 datasets in ODATA format, and 41 in XML format.

The city hosts Apps4BCN, a directory site of available apps built using city data and APIs. The directory includes reviews, where anyone can register as an expert user of apps and contribute, which in turn gives them a profile page. (So savvy app developers could use these experts as early adopters for user feedback on their future creations.)

Barcelona also invests in a Code for Europe initiative that currently has a Fellowship based at the city, working with internal staff on implementing Open 311 API standards so that citizens can register and communicate local issues such as broken city infrastructure directly via an application.

Barcelona has a number of partnerships aimed at fostering standardization in the use of APIs so that civic tech solutions created in another city are transferable locally. This includes CitySDK, iCity, and Open-DAI.

The city is also currently hosting a Smart City App Hack event. Unlike the hackathons that the city has hosted in the past, the Smart City App Hack allows dev teams to build apps over a period of months instead of a weekend.

Barcelona’s open data portal averages around 10,000 website visits each month.

Challenges

  • Navigation: While there is a lot of activity across the city’s operations, it takes some navigation to try and find APIs available for developers. There is no single point of access to discover the city’s APIs.
  • Documentation: Where APIs have been made available, there is no interactive documentation and no client libraries are provided for any of the APIs or datasets.
  • Developer marketplace: While Apps4BCN has an app user social network, it is difficult to locate a similar network or marketplace of developers who have expertise or interest in building civic tech solutions.
  • Terms of use: There are contradictions in Barcelona’s Open Data terms of use. Under Creative Commons Attribution 3.0, data can be used for commercial use and can be altered. However, the same terms of use also say the data is governed by Article 8 of the Spanish Act 37, which says that data cannot be altered in reuse. The city also reserves the right to charge for the data if it wants to in future.
  • Data ecosystem: While there are some links to other websites and partners that also host API data for the city, this is fairly ad hoc, and there is no mention of things like national statistics that might include some Barcelona-relevant datasets, and no mention of the work of the Catalan regional statistical agency, which also offers Barcelona-relevant data and has an API Developer Portal.

New York City

New York City has 8 APIs available via its developer portal, including a geoclient, an Open311 API, an event calendar, city government spending data, and several news and data feeds, including transport.

In addition, New York City has a Socrata-based open data portal, which means that all of the published datasets are available as APIs using Socrata’s Open Data API (SODA) standard. These are intended for community and hackathon use without a registration key, although it is possible to build small scale applications with up to 1,000 request calls per hour (with a registered key).

A roadmap clearly articulates the city’s planned data releases up until 2018. Current datasets are often provided in close-to-realtime. For example, building permits data includes data up until the previous working day.

Data visualizations and stories of how city APIs and open data are being used by business, researchers, and the community are showcased on the open data portal.

An annual NYC Big Apps competition has replaced the city’s hackathon approach, and aims to foster more sustainable civic tech product development over a six-month period. This includes social media profile pages for teams competing in events and progress updates on their product development. Team profile pages show what APIs they are using in their civic tech solutions. These pages could be used as a developer marketplace or directory for those seeking to collaborate with city API developers beyond the life of the competition.

Via the NYC Big Apps website, the city does signpost to a wider data and API ecosystem, including state open data sources, and proprietary API data services relevant to New York City, like Foursquare, Yelp, The New York Times, Mapbox, and SeatGeek. Interestingly, wider government open data APIs such as the Federal U.S. Census Bureau APIs are not referenced.

New York City’s developer portal currently has an average of around 6,000 visits each month, with half of visits coming from searches predominantly for the Geoclient mapping API.

Challenges

  • Data ecosystem: Within the NYC dev portal, the wider NYC data ecosystem is not fully signposted. For example, the NYC Metropolitan Transit Authority’s data feeds are not linked or mentioned on the dev portal. While technically, the MTA is a public authority overseen by New York State, that is not something that many developers or businesses would necessarily know. This results in the API for the Department of Transport referencing data feeds for traffic updates and truck routes through the city, without making any reference to MTA’s public transport system, or to other modes of transport such as the city’s bike share program or the city’s car share programs.
  • API Registration: Accessing API documentation is a little convoluted. Users must sign up for an API key first and then fill out some forms as if they are building an application. Once that workflow is in process, the interactive sandbox with the API documentation can then be used to test API calls.
  • Lack of activity: On the API Developer Portal, all of the requests from users for new APIs and comments on site feedback have gone unanswered for over a year. Where certain datasets are linked from the API to the wider open data portal (for example, looking at bike parking locations across the city) requests for updates are already 6 months old with no sense of engagement from city representatives.
  • Terms of use: API terms of use don’t say anything about use of NYC APIs in commercial applications. The terms stipulate that data can only be drawn from the city’s API endpoints if they are actively being used in the developer’s application. The final clause of the terms give the city the right to change the terms of use at any time, with immediate effect. All applications that use NYC APIs must have a privacy policy with their end users that explains how the application will use, share, and transfer data. The policy must also be published on the application’s landing page and in any marketplace where the application is available for download.

Continue reading on page two to learn more. 

Mark Boyd is a ProgrammableWeb writer covering breaking news, API business strategies and models, open data, and smart cities.

Comments