tfl-api-wrapper-0.1.0 has been yanked.
TFL API Wrapper
A rust crate for using the Transport for London (TFL) API.
Note: This is currently WIP and not ready for use.
Installation
Using cargo
, add this to your project's Cargo.toml
:
[]
= "0.1.0"
Implemented APIs
Currently only the version for the API is implemented.
Usage
Get the Keys from TFL API Portal
- If you don't already have an account, register on TFL API Portal.
- Vist the Products link and create a new subscription for
500 Requests per min
(allows 500 requests per min). - Next, visit your profile, scroll down to the
Primary key
section of your subscription, click onShow
and copy the value. You can use either ofPrimary key
orSecondary key
.
Use the crate
Instantiate the Client
using:
use ;
let client = new;
Here APP_KEY
could be either Primary key
or Secondary key
.
Example
Get the API version:
let vers = client
.api_version
.fetch
.await;
Tests
You can run the tests by running:
APP_KEY=hjdhajsdas
References/Credits
- Existing tfl wrappers
- tfl-api-wrapper - NodeJS wrapper for TFL API, made with TypeScript.
- tfl-api-wrapper-py - Python wrapper for TFL API
- go-tfl - Go client for TFL API
- Adzuna-rs - For existing wrapper implementation for Adzuna API.