Likes Likes:  1
Dislikes Dislikes:  0
ELITE ELITE:  0
Results 1 to 4 of 4

Thread: CaBi XML feed location and information

  1. #1
    Join Date
    Nov 2011
    Posts
    5
    Post Thanks / Like

    Default CaBi XML feed location and information

    Capital Bikeshare uses an XML feed to publish data station data. The feed is located at http://www.capitalbikeshare.com/data...keStations.xml (updated 1/31/12, old location now redirects)

    This feed contains data as outlined below:
    HTML Code:
    <stations lastUpdate="1328289754676" version="2.0">
      <station>
        <id>1</id>
        <name>20th & Bell St</name>
        <terminalName>31000</terminalName>
        <lat>38.8561</lat>
        <long>-77.0512</long>
        <installed>true</installed>
        <locked>false</locked>
        <installDate>1316059200000</installDate>
        <removalDate/>
        <temporary>false</temporary>
        <nbBikes>3</nbBikes>
        <nbEmptyDocks>8</nbEmptyDocks>
        <latestUpdateTime>1328287786738</latestUpdateTime>
      </station>
    
    ... additional stations removed ...
    
    </stations>
    where:

    Code:
    stations: lastUpdate: a timestamp* of when the XML file was updated
    station:
      id: a numeric identifier of the station
      name: the station's name
      terminalName: the terminal #
      lat: geographic Latitudinal coordinate
      long: geographic Longitudinal coordinate 
      installed: true or false
      locked: true or false, A station can be locked administratively. I think this makes the station inoperable, but it may just prevent bikes from being checked out while still allowing bikes to be checked in.
      installDate: a timestamp* of when the station was installed, can be null.
      removalDate: a timestamp* of when the station was removed, can be null.
      temporary: true or false
      nbBikes: the number of bicycles currently docked at this station. I believe it only displays working bicycles (bicycles not marked as needing service).
      nbEmptyDocks: the number of currently available docks. I believe it only displays working docks.
      latestUpdateTime: This appears to be a timestamp* of when the station last saw activity. This field was added sometime mid-2011. The description has not been officially confirmed**.
    
    * timestamps are 13-digit timestamp (10-digit UNIX timestamp + 3 digit millisecond value)
    ** The evidence that supports the definition of LatestUpdateTime: The sample data above was captured shortly after 12:22:34 PM on Friday, February 03, 2012 (lastUpdate: 1328289754676). Station 1 contained 3 bikes and 8 docks. The latestUpdateTime for this station was 1328287786738 which equals Friday, February 03, 2012 11:49:46 AM. A look at cabitracker.com on the page for Station 1 at February 3, 2012 yields a graph that showed that station's status throughout the day. At 11:49 AM the station was reporting 4 bikes and 7 docks, but at 11:50 AM the station was reporting  3 bikes and 8 docks. This time corresponds perfectly with the latestUpdateTime above.

  2. #2
    Join Date
    Feb 2012
    Posts
    1
    Post Thanks / Like

    Default

    If you liked it, then you shoulda an put an API on it! Oh wait, let's do that.

    This is all stuff I slapped together in a few hours about a year ago, but it still works -- bounces off the CaBi XML feed. Use a GET request, it returns JSON. Doesn't have an API key or rate limiting or anything; just please try to not completely overwhelm my free shared hosting plan? I need it to host my months-out-of-date resume.

    Example:
    {"hasData":true,"stationName":"20th & Bell St","latitude":38.8561,"longitude":-77.0512,"stationId":1,"bikesAvailable":3,"docksOpe n":8,"isInstalled":true,"isLocked":false,"isOnline ":true,"distance":0}

    http://kylehill.net/transit/GetNearestWithBike - returns data about a specific CaBi station.
    Mandatory Parameter:
    id: Station ID number.

    http://kylehill.net/transit/GetStations - returns all CaBi Stations, including those locked/deactivated.
    Optional Parameters:
    lat, lon: Show station's distance, in as-the-crow-files miles, from current coordinates. (Obviously if you use lat or lon, use both.)
    ct: Number of stations to show. Defaults to all.
    (http://kylehill.net/transit/GetStati...77.057590&ct=5 shows the nearest five stations from my office front door. I have one literally across the street. Be jealous, kids.)

    http://kylehill.net/transit/GetNearestWithBike - returns nearest CaBi stations with available bikes.
    Mandatory Parameters:
    lat, lon: Show station's distance, in as-the-crow-files miles, from current coordinates.
    Optional Parameter:
    ct: Number of stations to show. Defaults to all.

    http://kylehill.net/transit/GetNearestWithDock - returns nearest CaBi stations with available docks.
    Mandatory Parameters:
    lat, lon: Show station's distance, in as-the-crow-files miles, from current coordinates.
    Optional Parameter:
    ct: Number of stations to show. Defaults to all.

  3. #3
    Join Date
    Nov 2011
    Posts
    5
    Post Thanks / Like

    Default

    Kyle, I think you should create a new post with this information, as it deserves its own space. I'll even have some stuff to add to it.

  4. #4
    Join Date
    May 2011
    Posts
    191
    Post Thanks / Like

    Default

    Quote Originally Posted by dgohlke View Post
    Capital Bikeshare uses an XML feed to publish data station data. The feed is located at http://www.capitalbikeshare.com/data...keStations.xml
    That's great. I'm surprised it shows the Nannie Helen Burroughs & Minnesota Ave NE station. It's not yet installed, but set to public. That explains the one white bubble on the map (which I'd been finding odd, as it's not referenced in the key). It also identified one station as temporary.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •