City of Surrey Traffic Loop Count API.
surrey · Data
This API provides locations of City of Surrey traffic loops and the corresponding traffic loop counts in 15 minute intervals. While the counts are broken up by 15 minute intervals, the data is currently loaded only once per day. We are hoping to increase this frequency to at least once every hour. The LOOP_ID field is common to both datasets and can be used to cross-reference them.
Authentication
Sample Requests
Provides traffic loop counts for the input time interval. The LOOP_ID and DATETIME combinations are unique in the output. The output timestamp will contain the time zone offset, either -08 (PST) or -07 (PDT) depending on whether daylight savings time was observed at the output datetime. In order to
Hover any highlighted part to learn what it does
curl -X GET "https://api.apis.guru/v2/specs/surrey.ca/trafficloops/0.1/TrafficLoopCounts.fmw?enddatetime=1&startdatetime=1"
import requests
params = {
"enddatetime": "1",
"startdatetime": "1"
}
response = requests.get(
"https://api.apis.guru/v2/specs/surrey.ca/trafficloops/0.1/TrafficLoopCounts.fmw",
params=params,
)
print(response.json())const url = new URL('https://api.apis.guru/v2/specs/surrey.ca/trafficloops/0.1/TrafficLoopCounts.fmw');
url.searchParams.set('enddatetime', '1');
url.searchParams.set('startdatetime', '1');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/surrey.ca/trafficloops/0.1/TrafficLoopCounts.fmw")
q := baseURL.Query()
q.Set("enddatetime", "1")
q.Set("startdatetime", "1")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/surrey.ca/trafficloops/0.1/TrafficLoopCounts.fmw")
uri.query = URI.encode_www_form({
"enddatetime" => "1",
"startdatetime" => "1"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/surrey.ca/trafficloops/0.1/TrafficLoopCounts.fmw?" . http_build_query([
"enddatetime" => "1",
"startdatetime" => "1"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Provides all the traffic loops maintained by the City of Surrey in GeoJSON format. LANE_DIRECTION indicates the heading of the traffic (NB, SB, EB, WB). INTERSECTION_ID corresponds to the INTID field in the intersections dataset which can be found on the Surrey Open Data site. ROAD_FACILITYID indica
Hover any highlighted part to learn what it does
curl -X GET "https://api.apis.guru/v2/specs/surrey.ca/trafficloops/0.1/TrafficLoops.fmw?proj_epsg=1"
import requests
params = {
"proj_epsg": "1"
}
response = requests.get(
"https://api.apis.guru/v2/specs/surrey.ca/trafficloops/0.1/TrafficLoops.fmw",
params=params,
)
print(response.json())const url = new URL('https://api.apis.guru/v2/specs/surrey.ca/trafficloops/0.1/TrafficLoops.fmw');
url.searchParams.set('proj_epsg', '1');
const response = await fetch(url);
const data = await response.json();
console.log(data);package main
import (
"fmt"
"io"
"net/http"
"net/url"
)
func main() {
baseURL, _ := url.Parse("https://api.apis.guru/v2/specs/surrey.ca/trafficloops/0.1/TrafficLoops.fmw")
q := baseURL.Query()
q.Set("proj_epsg", "1")
baseURL.RawQuery = q.Encode()
targetURL := baseURL.String()
req, _ := http.NewRequest("GET", targetURL, nil)
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}require "net/http"
require "json"
uri = URI("https://api.apis.guru/v2/specs/surrey.ca/trafficloops/0.1/TrafficLoops.fmw")
uri.query = URI.encode_www_form({
"proj_epsg" => "1"
})
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
req = Net::HTTP::Get.new(uri)
res = http.request(req)
puts JSON.parse(res.body)<?php
$url = "https://api.apis.guru/v2/specs/surrey.ca/trafficloops/0.1/TrafficLoops.fmw?" . http_build_query([
"proj_epsg" => "1"
]);
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Postman Setup Guide
- See official documentation for authentication and setup.
What can you build with City of Surrey Traffic Loop Count API.?
City of Surrey Traffic Loop Count API. is a Data API. Developers commonly use data APIs for:
- enriching your app with third-party datasets
- building data pipelines and ETL workflows
- querying and searching large datasets
- powering research, analysis, and reporting tools
- syncing reference data into your own systems
No authentication required. This API is open — no signup or key needed. Ideal for quick prototypes and public-facing features. City of Surrey Traffic Loop Count API. is free to use, making it a low-risk choice to experiment with.
New to APIs? Read our beginner's guide · Learn about API keys · What is REST?