Esri's Geotrigger Service is replacing Geoloqi! Learn More | FAQ

location/history

Contents

URL

https://api.geoloqi.com/1/location/history

Description

Retrieves the current user's location history, by date range or bounding box.

Note: By default, all apps created after August 13, 2013 do not store location history for their users. If you would like to enable this feature, please contact [email protected] to request access. You will need to be able to demonstrate your application's need for storing and retrieving history, and we will work with you to find a paid plan that can accommodate your needs.

Supported Request Methods

GET

Output Formats

json, xml, gpx, kml

By default, location history is returned in JSON format. Optionally history can be returned in GPX or KML formats. To specify a different output format, append the file extension to the end of the path, for example, location/history.gpx.

Parameters

Optional

  • count (default: 10)
    Return the most recent n points of history
    location/history?count=100
  • after
    Return points more recent than the given timestamp. Dates should be given in iso8601 format or as a unix timestamp.
    location/history?after=1280340811
  • before
    Return points older than the given timestamp. Dates should be given in iso8601 format or as a unix timestamp.
    location/history?before=1280340811
  • sort (default: asc) asc or desc
    Sort the points returned in ascending or descending order. If you're retrieving the latest 500 points, you should sort by "desc" but if you're downloading historical data in chunks you should probably sort by "asc".
    location/history?after=1280340811&sort=asc
  • accuracy (default: 150)
    Return points with an accuracy greater than the given value. Rough location fixes from the cell tower will usually have an accuracy of 500 meters, so querying data more accurate than 200 meters will give you good results.
    location/history?accuracy=200
  • thinning (default: 0)
    The "thinning" parameter will thin the history data by 1/n so you get slightly less accurate data but it will be spread out over a longer period of time. For example, if the user records 100 points in an hour, and you set thinning to 2, returning the last 100 points will return data logged in the last 2 hours. The points are chosen at random, so you will get slightly different results if you run this repeatedly. Set to "0" or omit the parameter to turn thinning off.
  • geometry
    If you want to query points by geometry, set this parameter to the type of geometry you're specifying. circle or rectangle are the two modes that are currently supported. Some of the below parameters will be required based on the search type.
    location/history?geometry=circle&center=45.511,-122.633&radius=0.5 or location/history?geometry=rectangle&sw=45.504,-122.653&ne=45.512,-122.644
  • center Required for geometry=point
    When querying for data within a circle, specify the center of the circle in the format lat,long.
  • radius Required for geometry=point
    When querying for data within a circle, specify the radius of the circle in meters.
  • sw Required for geometry=rectangle
    When querying for data within a rectangle, specify the southwest corner of the rectangle in the format lat,long.
  • ne Required for geometry=rectangle
    When querying for data within a rectangle, specify the northeast corner of the rectangle in the format lat,long.
  • ignore_gaps (default: 0)
    By default, the query will attempt to identify "gaps" in the location stream and will only return points for the last trip up to the gap. This should make things look better when plotted onto the map. To disable this behavior, set this parameter to 1
  • no_points Optional
    If no_points=1, the API will not include the actual location data in the response. Instead, only the meta information such as bounding box, time range, and start and end points is returned.
  • batch Optional
    If batch=true, you will get back a hash that can be used to delete the locations using location/delete_batch/:id

JSON Response

{
  "points":[
    {
      "uuid":"9779731d-de56-458c-899c-93bd520fb6e8",
      "date":"2011-06-12T19:05:28-07:00",
      "date_ts":1307930728,
      "location":{
        "position":{
          "latitude":45.445793867111,
          "longitude":-122.64261245728,
          "speed":1,
          "altitude":0,
          "heading":3,
          "horizontal_accuracy":24,
          "vertical_accuracy":null
        },
        "type":"point"
      },
      "raw":{
        "battery":86,
        "rate_limit":60
      }
    },
    {
      "uuid":"b83a2bd6-1f10-4209-ad24-786caed63f28",
      "date":"2011-06-12T19:28:58-07:00",
      "date_ts":1307932136,
      "location":{
        "position":{
          "latitude":45.445793867111,
          "longitude":-122.64261245728,
          "speed":1,
          "altitude":0,
          "heading":null,
          "horizontal_accuracy":24,
          "vertical_accuracy":null
        },
        "type":"point"
      },
      "raw":{
        "battery":86,
        "rate_limit":60
      }
    }
  ],
  "distance":408.38,
  "timerange":{
    "from":"2011-11-18T21:05:37+00:00",
    "from_ts":1321650337,
    "to":"2011-11-18T21:39:54+00:00",
    "to_ts":1321652394
  },
  "bounds":{
    "sw":{
      "latitude":45.525467377198,
      "longitude":-122.68037846323
    },
    "ne":{
      "latitude":45.526795322118,
      "longitude":-122.67881632794
    }
  },
  "batch":"4f20ecd94e428dcb41b39f36d28fbb289c71392b"
}

GPX Response

<?xml version="1.0" ?>
<gpx>
  <metadata>
    <link href="http://geoloqi.com/">
      <text>Geoloqi</text>
    </link>
    <time>2011-11-19T22:39:04+00:00</time>
  </metadata>
  <trk>
    <name>GPX Export</name>
    <trkseg>
      <trkpt lat="45.526636526962" lon="-122.68029070471">
        <ele>10</ele>
        <time>2011-11-19T08:50:39-08:00</time>
      </trkpt>
      <trkpt lat="45.526661127848" lon="-122.68013027508">
        <ele>8</ele>
        <time>2011-11-19T08:50:45-08:00</time>
      </trkpt>
      <trkpt lat="45.5266913027" lon="-122.68007193703">
        <ele>13</ele>
        <time>2011-11-19T08:50:54-08:00</time>
      </trkpt>
      <trkpt lat="45.526809445625" lon="-122.68007512216">
        <ele>18</ele>
        <time>2011-11-19T08:51:00-08:00</time>
      </trkpt>
      <trkpt lat="45.526856468102" lon="-122.68000789929">
        <ele>14</ele>
        <time>2011-11-19T08:51:05-08:00</time>
      </trkpt>
      <trkpt lat="45.526812588838" lon="-122.68001175497">
        <ele>12</ele>
        <time>2011-11-19T08:51:14-08:00</time>
      </trkpt>
      <trkpt lat="45.526716071223" lon="-122.68004276801">
        <ele>10</ele>
        <time>2011-11-19T08:51:22-08:00</time>
      </trkpt>
      <trkpt lat="45.526567921085" lon="-122.68003086571">
        <ele>4</ele>
        <time>2011-11-19T08:51:28-08:00</time>
      </trkpt>
      <trkpt lat="45.526226861445" lon="-122.67999365006">
        <ele>3</ele>
        <time>2011-11-19T08:51:33-08:00</time>
      </trkpt>
      <trkpt lat="45.52662630104" lon="-122.68004276801">
        <ele>19</ele>
        <time>2011-11-19T08:51:39-08:00</time>
      </trkpt>
    </trkseg>
  </trk>
</gpx>

KML Response

<?xml version="1.0" ?>
<kml>
  <Document>
    <name>Trip</name>
    <description>Geoloqi Path</description>
    <Style id="mainLineStyle">
      <LineStyle>
        <color>ffaefab3</color>
        <width>4</width>
      </LineStyle>
      <PolyStyle>
        <color>ffaefab3</color>
      </PolyStyle>
    </Style>
    <Folder>
      <name>Points</name>
    </Folder>
    <Placemark>
      <name>Trip</name>
      <description>Geoloqi Path</description>
      <styleUrl>#mainLineStyle</styleUrl>
      <LineString>
        <extrude>0</extrude>
        <tessellate>0</tessellate>
        <altitudeMode>absolute</altitudeMode>
        <coordinates>
          -122.68029070471,45.526636526962,10 -122.68013027508,45.526661127848,8 -122.68007193703,45.5266913027,13 -122.68007512216,45.526809445625,18 -122.68000789929,45.526856468102,14 -122.68001175497,45.526812588838,12 -122.68004276801,45.526716071223,10 -122.68003086571,45.526567921085,4 -122.67999365006,45.526226861445,3 -122.68004276801,45.52662630104,19 
        </coordinates>
      </LineString>
    </Placemark>
  </Document>
</kml>