I write a lot of back end code and sometimes have to make use of HTTP endpoints. Sometimes I want to test those endpoints. I used to use httpbin.org for my endpoint testing, but over time noticed that some of the endpoints were returning HTTP 5xx errors. Some investigation reveals that the project seems to be abandoned, with open issues going all the way back to 2017. That’s not so good.
So I decided to build my own.
In this post I’d like to talk about FastAPI Httpbin. But before I can, I need to talk about FastAPI itself. FastAPI is a framework for building high-performance frameworks in Python based on Python type hints. The really neat thing about FastAPI is that your function definition for each endpoint is the source of truth–FastAPI handles argument validation for any calls to that endpoint, and generates the appropriate Swagger documentation for that endpoint. Continue reading “Introducing FastAPI Httpbin”
With the release of SEPTA’s new app, I’ve suddenly been flooded with questions about their API. People wanted to know how stable it was.
Well, I don’t work for SEPTA, which means I don’t have insight into their operations, but I can perform some analytics based on what I have, which is approximately 18 months of Regional Rail train data, read every minute by SEPTA Stats.
This is all of the data that I have in Septa Stats currently:
- Events Since Inception: 26,924,887 events
- First Event: Mar 1, 2016 12:00:01 AM
- Last Event: Nov 16, 2017 10:33:53 PM
That’s way more events than minutes in that timeframe, and the reason for that is each API query is split into a separate event for each train. So if an API call returns status for 20 trains, that gets split into 20 different events. This is done because Splunk has a much easier time working with JSON that isn’t a giant array. 🙂 Continue reading “Examining 12 Months of SEPTA API Queries”
While waiting for a train at Ardmore station yesterday, I decided to check it out on SEPTA Stats to see just how late it was, and where it was. This is what I saw:
Well… that can’t be right. It’s an inbound train, and I had been standing at Ardmore station for the last 10 minutes. No trains came through in that time. What’s going on? Continue reading “Found Buggy Train Data In SEPTA’s API”
…and 2 new API endpionts, too. But more on those later.
I’m proud to say that there is now a dashboard for the entire Regional Rail system. It is present on both the front page and the “SEPTA System Stats” page:
This new dashboard makes it straightforward to determine the status of the entire Regional Rail system at a glance. Continue reading “Introducing the SEPTA Regional Rail System Dashboard!”
On the heels of yesterday’s post, I’ve introduced dashboards for train lines.
The dashboard will provide a snapshot of the current status of the line, namely the number of trains, average lateness, and how many trains are over 5 minutes late. Continue reading “Train Line Dashboards Now Available”
I’m pleased to announce that dashboards are now available on train views.
Prior to the introduction of the dashboard, it was difficult to tell if a train was running, what route it was on, and what station it was at. This new dashboard makes use of the “latest” API endpoint described in the previous post to provide a snapshot of the current status of the train. Continue reading “Train Dashboards Now Available”