TravelBadge Docs


About TravelBadge

Introducing the free Tube status widget service: TravelBadge, the ultimate solution for businesses looking to keep their customers informed about any travel disruptions that could affect their visit. With near real-time updates on Tube service interruptions directly embedded into your website, you can ensure seamless customer experiences and boost foot traffic by helping patrons plan their journeys hassle-free. Stay ahead of the curve and enhance customer satisfaction effortlessly with our user-friendly widget.


Basic Usage

TravelBadge relies on images. As a new image is requested from the server, a response is returned with up-to-date service details. The images can be inserted into any html page using <img> tags, or any other image linking method.

            <!-- Basic TravelBadge usage -->
            <img src="https://travelbadge.uk/line/elizabeth">
        
            
        

Supported Lines

TravelBadge supports every one of the core Tube lines, as well as the Elizabeth line, the London Overground, the Docklands Light Railway, and London Trams.
The acceptable terms for use in widget URLs are as follows:


Specifying Output Filetype

The URL for the image can either specify a file extension or not, in which case it defaults to SVG to ensure clear display at any size. Currently available filetypes are .svg and .png.
Some developers may choose to embed the widgets as images rather than vectors:

            <!-- Specify output as a raster image -->
            <img src="https://travelbadge.uk/line/waterloo-and-city.png">
        
            
        

To ensure clarity, a .svg extension can be specified, but this will result in the same behaviour as if no extension were specified.

            <!-- Specify output as an SVG -->
            <img src="https://travelbadge.uk/line/dlr.svg">
        
            
        

Alternative Embed Formats

TravelBadge widgets are just images. As such, they can be embedded through a variety of different methods. For web use, an <img> tag can be used. It is recommended for accessibility purposes that you also include alt text describing the nature of the image.

            <!-- HTML image embed -->
            <img alt="Northern Line Status" src="https://travelbadge.uk/line/northern">
        
            Northern Line Status
        

For certain documents, such as blog posts, a markdown format can be used where the image is specified in the format ![alt text](URL).

            *Markdown image embed*
            ![Jubilee Line Status](https://travelbadge.uk/line/jubilee)
        
            Jubilee Line Status
        

Speed, Updates, and Rate Limiting

For line status, TravelBadge updates directly from Transport for London's API every 15 minutes. Between then, all images are cached to serve to the user without having to re-query TfL's data.
This time period has been carefully chosen to prevent as little disruption for end users as possible by remaining fast and up-to-date, whilst also preventing undue stress on TfL's servers.
Please note: TravelBadge is in no way affiliated with Transport for London.

To prevent abuse of the service, TravelBadge has a very generous rate limit on a per-end-user basis. The rate limit is designed in such a manner that any standard user will almost never encounter a block, and even if they do, it only lasts a handful of minutes before the quota resets. TravelBadge has additional layers of security preventing abuse or misuse of the service, and any attempted circumventions of these measures may result in the TravelBadge service being blocked from their use.


Changelog

Upcoming Release: Announcement-style status text generator (e.g. 'There are minor delays on the Circle line. There is good service on all other lines.')