Skip to content

Commit 70cf8cd

Browse files
committed
Forgot to save file 🤦‍♂️
1 parent 1dd6c4a commit 70cf8cd

1 file changed

Lines changed: 223 additions & 0 deletions

File tree

docs/endpoints.md

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

0 commit comments

Comments
 (0)