TransportAPI Release Interactive Usage Examples

24 Jun 2021 by David Mountain

At TransportAPI we are lucky enough to see the things that developers using our API build every day.

There are some magnificent examples out there, from the First Bus app with its need for high quality data, high performance and robust architecture. Through to Balena IO’s Chris Crocker-White who developed a Raspberry Pi powered live train station departures display for his desk.

As an API provider, the majority of the documentation that we produce describes what our endpoints do: mostly HTTP requests and machine-readable resources. Increasingly, we’ve been interested in not just describing what endpoints do, but showing how they can be used, and to meet this need, we’ve started to develop and release TransportAPI usage examples.

These usage examples are intended for a technical audience, and there are two main objectives. First, to provide some inspiration for what can be built, using the API. Second, as tutorials to get started, with code you can reuse in your applications.

The usage examples are mini web applications, written in HTML and JavaScript. They deliberately focus on functionality, rather than style: we don’t want code showing how data can be processed to get lost in a sea of CSS and formatting. For each example, we provide the code required to run the web application in a browser, and a cached copy of data from one or more TransportAPI endpoints. The code is rendered by CodeSandbox where the example can be opened, and edited. If you have an API key for TransportAPI (you can sign up for a free trial) you can add it to your requests and start retrieving live data, in place of the cached files.

We’ve developed eight usage examples so far, and have plenty more planned, so come back from time to time to see what is new.

If you have an idea for a usage example that you’d like to see, or a use case in mind that you would like us to account for, then get in touch and let us know https://www.transportapi.com/contact/. We look forward to hearing your ideas.

Transport API