Question about Stop API

14 views
Skip to first unread message

Nayef Al Rayes

unread,
Jul 24, 2025, 6:29:05 PMJul 24
to 511sfbaydevel...@googlegroups.com
Hello!

I am working on a project that involves collecting all the transit routes for any given stop. I've decided the best way to do this would be using the 511 API.

I am facing an issue with the "Stop" API. 

Whenever I send a request with the include_stop_areas set to true, I get back a 412 error. For example, when I submit a request with this URL (https://api.511.org/transit/stops?api_key=[MY_KEY]&operator_id=SF&line_id=30X&include_stop_areas=true)I get this response with a status code of 412, with this response body:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>412 - Precondition set by the client failed when evaluated on the Web server.</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;}
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;}
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
 <div class="content-container"><fieldset>
  <h2>412 - Precondition set by the client failed when evaluated on the Web server.</h2>
  <h3>The request was not completed due to preconditions that are set in the request header. Preconditions prevent the requested method from being applied to a resource other than the one intended. An example of a precondition is testing for expired content in the page cache of the client.</h3>
 </fieldset></div>
</div>
</body>
</html>


Notably, this still happens if I set include_stop_areas to false. However, when I remove the include_stop_areas parameter entirely, it works just fine. i.e. https://api.511.org/transit/stops?api_key=[MY_KEY]&operator_id=SF&line_id=30X gives me a 200 OK.

Any idea what the issue here is? 

Thanks!
Nayef

Nisar Ahmed

unread,
Jul 25, 2025, 12:09:16 PMJul 25
to 511sfbaydevel...@googlegroups.com, Mengjie Han

We will investigate and respond back as soon as possible.

 

--Nisar

 

From: 511sfbaydevel...@googlegroups.com <511sfbaydevel...@googlegroups.com> On Behalf Of Nayef Al Rayes
Sent: Thursday, July 24, 2025 3:28 PM
To: 511sfbaydevel...@googlegroups.com
Subject: [511SFBayDeveloperResources] Question about Stop API

 

You don't often get email from thena...@gmail.com. Learn why this is important

*External Email*

 

--
You received this message because you are subscribed to the Google Groups "511SFBayDeveloperResources" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 511sfbaydeveloperre...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/511sfbaydeveloperresources/CAAhepG2eycvq0n-Z09g1OC66YMr%3DQqPxa6odt9viRSbxhGiWng%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages