{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"6fcf7d66-641e-4bfc-b011-02b492422994","name":"ATLYST API Doc v0.2.1","description":"## **For the Latest ATLYST API Documentation please visit:** [https://documenter.getpostman.com/view/26157408/2s946eAtLY](https://documenter.getpostman.com/view/26157408/2s946eAtLY)\n\n## Authentication\n\nTo get access to the ATLYST API you will require an API key, please contact [atlyst@metrocount.com](https://mailto:atlyst@metrocount.com) to request a key for your organisation.\n\nThe key must be passed in the header of all requests as \"APIKEY\" : \"keystring\"\n\n## Python Examples API Usage with Requests Library\n\n``` python\nimport requests\nheaders = {\"APIKEY\": \"your api key\"}\n# get all site list in json response\nsite_list_url = \"https://atlyst.metrocount.com/api/list_sites/\"\nsite_list_request = requests.post(site_list_url, headers=headers)\n# get the json response with all sites\nsite_list_response = site_list_request.json()\n# get the interval statistics for the first site in site list response\ninterval_stats_url = \"https://atlyst.metrocount.com/api/interval_site_statistics/\"\nfirst_site_id = site_list_response[0][\"site_id\"]\ninterval_stats_request_body = {\"site_id\": first_site_id}\n# get the interval statistics for the first site in site list response\nrequest_interval_stats = requests.post(interval_stats_url, headers=headers, data=interval_stats_request_body)\nprint(request_interval_stats.json())\n\n ```\n\n## Querying Individual Vehicles Code Example\n\n``` python\nfrom dateutil.parser import parse\nimport requests\n# IMPORTANT: declare start_timestamp and end_timestamp both in UTC\nstart_timestamp = '2019-07-01T00:00:00+00:00'\nend_timestamp = '2019-08-01T00:00:00+00:00'\n# parse to Python datetime for comparison\nstart_dt = parse(start_timestamp)\nend_dt = parse(end_timestamp)\n# create requests variables\nheaders = {\"APIKEY\": apikey}\nind_veh_url = \"https://metrocount.io/api/individual_vehicles/\"\n# initialise loop variables\nlast_dt = start_dt\nveh_counts = 0\nlast_timestamp = start_timestamp\nwhile last_dt < end_dt:\n    # compose the requested data body\n    print(f\"Query vehicles from timestamp {last_timestamp}\")\n    body = {\n        \"site_id\":5541,\n        \"start_timestamp\": last_timestamp,\n        'limit':100000\n    }\n    # make the request\n    ind_veh_request = requests.post(ind_veh_url, headers=headers, data=body)\n    cur_data = ind_veh_request.json()[\"data\"]\n    # stop the loop if no more data is available\n    if not cur_data:\n        break\n    data_len = len(cur_data)\n    print(f\"Retrieved {data_len} records\")\n    veh_counts += data_len\n    last_timestamp = cur_data[-1][0] # use the timestamp(UTC) as the new query params\n    last_dt = parse(last_timestamp) # update the last_dt for loop comparison\n\n ```","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":true,"owner":"2950534","team":2447003,"collectionId":"6fcf7d66-641e-4bfc-b011-02b492422994","publishedId":"TVYGbd3H","public":true,"publicUrl":"https://documenter-api.postman.tech/view/2950534/TVYGbd3H","privateUrl":"https://go.postman.co/documentation/2950534-6fcf7d66-641e-4bfc-b011-02b492422994","customColor":{"top-bar":"FFFFFF","right-sidebar":"001D33","highlight":"005BBD"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.10.1","publishDate":"2021-03-03T06:33:41.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/64c406cce052792f27af03b998049399266fa7961a80e7ece7930ecffd50c4cf","favicon":""},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"}],"canonicalUrl":"https://documenter.gw.postman.com/view/metadata/TVYGbd3H"}