Skip to content

Commit 1dd6c4a

Browse files
committed
Moved endpoint docs to separate file
1 parent 57cb27f commit 1dd6c4a

2 files changed

Lines changed: 4 additions & 224 deletions

File tree

README.md

Lines changed: 4 additions & 224 deletions
Original file line numberDiff line numberDiff line change
@@ -6,230 +6,6 @@ MTAPI is a small HTTP server that converts the [MTA's realtime subway feed](http
66

77
This project is under active development and any part of the API may change. Feedback is very welcome.
88

9-
## Endpoints
10-
11-
- **/by-location?lat=[latitude]&lon=[longitude]**
12-
Returns the 5 stations nearest the provided lat/lon pair.
13-
```javascript
14-
{
15-
"data": [
16-
{
17-
"N": [
18-
{
19-
"route": "6",
20-
"time": "2014-08-29T14:00:55-04:00"
21-
},
22-
{
23-
"route": "6X",
24-
"time": "2014-08-29T14:10:30-04:00"
25-
},
26-
...
27-
],
28-
"S": [
29-
{
30-
"route": "6",
31-
"time": "2014-08-29T14:04:14-04:00"
32-
},
33-
{
34-
"route": "6",
35-
"time": "2014-08-29T14:11:07-04:00"
36-
},
37-
...
38-
],
39-
"hasData": true,
40-
"id": 123,
41-
"location": [
42-
40.725606,
43-
-73.9954315
44-
],
45-
"name": "Broadway-Lafayette St / Bleecker St",
46-
"routes": [
47-
"6X",
48-
"6"
49-
],
50-
"stops": {
51-
"637": [
52-
40.725915,
53-
-73.994659
54-
],
55-
"D21": [
56-
40.725297,
57-
-73.996204
58-
]
59-
}
60-
},
61-
{
62-
"N": [
63-
{
64-
"route": "6X",
65-
"time": "2014-08-29T14:09:30-04:00"
66-
},
67-
{
68-
"route": "6",
69-
"time": "2014-08-29T14:13:30-04:00"
70-
},
71-
...
72-
],
73-
"S": [
74-
{
75-
"route": "6",
76-
"time": "2014-08-29T14:05:14-04:00"
77-
},
78-
{
79-
"route": "6",
80-
"time": "2014-08-29T14:12:07-04:00"
81-
},
82-
...
83-
],
84-
"hasData": true,
85-
"id": 124,
86-
"location": [
87-
40.723315,
88-
-73.9974215
89-
],
90-
"name": "Spring St / Prince St",
91-
"routes": [
92-
"6X",
93-
"6"
94-
],
95-
"stops": {
96-
"638": [
97-
40.722301,
98-
-73.997141
99-
],
100-
"R22": [
101-
40.724329,
102-
-73.997702
103-
]
104-
}
105-
},
106-
...
107-
],
108-
"updated": "2014-08-29T15:27:27-04:00"
109-
}
110-
```
111-
112-
- **/by-route/[route]**
113-
Returns all stations on the provided train route.
114-
```javascript
115-
{
116-
"data": [
117-
{
118-
"N": [
119-
{
120-
"route": "6X",
121-
"time": "2014-08-29T14:01:54-04:00"
122-
},
123-
{
124-
"route": "5",
125-
"time": "2014-08-29T14:04:35-04:00"
126-
},
127-
{
128-
"route": "4",
129-
"time": "2014-08-29T14:07:00-04:00"
130-
},
131-
...
132-
],
133-
"S": [
134-
{
135-
"route": "6",
136-
"time": "2014-08-29T14:01:53-04:00"
137-
},
138-
{
139-
"route": "4",
140-
"time": "2014-08-29T14:04:52-04:00"
141-
},
142-
...
143-
],
144-
"hasData": true,
145-
"id": 12,
146-
"location": [
147-
40.804138,
148-
-73.937594
149-
],
150-
"name": "125 St",
151-
"routes": [
152-
"6X",
153-
"5",
154-
"4",
155-
"6"
156-
],
157-
"stops": {
158-
"621": [
159-
40.804138,
160-
-73.937594
161-
]
162-
}
163-
},
164-
{
165-
"N": [
166-
{
167-
"route": "5",
168-
"time": "2014-08-29T14:07:05-04:00"
169-
},
170-
{
171-
"route": "4",
172-
"time": "2014-08-29T14:09:30-04:00"
173-
},
174-
...
175-
],
176-
"S": [
177-
{
178-
"route": "4",
179-
"time": "2014-08-29T14:02:22-04:00"
180-
},
181-
{
182-
"route": "5",
183-
"time": "2014-08-29T14:03:36-04:00"
184-
},
185-
...
186-
],
187-
"hasData": true,
188-
"id": 123,
189-
"location": [
190-
40.813224,
191-
-73.929849
192-
],
193-
"name": "138 St - Grand Concourse",
194-
"routes": [
195-
"5",
196-
"4"
197-
],
198-
"stops": {
199-
"416": [
200-
40.813224,
201-
-73.929849
202-
]
203-
}
204-
},
205-
...
206-
],
207-
"updated": "2014-08-29T15:25:27-04:00"
208-
}
209-
```
210-
211-
- **/by-id/[id],[id],[id]...**
212-
Returns the stations with the provided IDs, in the order provided. IDs should be comma separated with no space characters.
213-
214-
- **/routes**
215-
Lists available routes.
216-
```javascript
217-
{
218-
"data": [
219-
"S",
220-
"L",
221-
"1",
222-
"3",
223-
"2",
224-
"5",
225-
"4",
226-
"6",
227-
"6X"
228-
],
229-
"updated": "2014-08-29T15:09:57-04:00"
230-
}
231-
```
232-
2339
## Running the server
23410

23511
MTAPI is a Flask app designed to run under Python 3.3+.
@@ -246,6 +22,10 @@ If your configuration is named something other than `settings.cfg`, set the `MTA
24622

24723
This app makes use of Python threads. If running under uWSGI include the --enable-threads flag.
24824

25+
## Endpoints
26+
27+
[Endpoints to retrieve train data and sample input and output are listed here.](https://github.com/jonthornton/MTAPI/tree/master/docs/endpoints.md)
28+
24929
## Settings
25030

25131
- **MTA_KEY** (required)

docs/endpoints.md

Whitespace-only changes.

0 commit comments

Comments
 (0)