Using public dtop cameras and artificial intelligence we're estimating the current traffic conditions in San Juan.
We're providing an API for developers to analyze and make use of the public DTOP data here in San Juan as well as our machine learning predictions on the rate of traffic currently taking place.
View Live ResultsA GET request to our endpoint (https://sanjuanpuertorico.org/api/v1/traffic) will return you a JSON array of arrays of values as follows
[
[
"static/img/26-0.1_01_MD-IPV.jpg", // Image from sanjuanpuertorico.org - https://sanjuanpuertorico.org/static/img/26-0.1_01_MD-IPV.jpg
"http://its.dtop.gov.pr/images/cameras/26-0.1_01_MD-IPV.jpg", // DTOP image
"http://its.dtop.gov.pr/en/TrafficImage.aspx?id=119&Large=1", // DROP embed
"San Juan Cam #1", // Internal Cam Name
"low", // PREDICTION for current traffic flow at returned time
18.458339088897567, // Latitude of camera
-66.08570387019088, // Longitude of camera
"11-20-2021 10:34" // time and date of currently available DTOP image
]
]
CURL:
curl --request GET \
--url https://sanjuanpuertorico.org/api/v1/traffic \
--header 'content-type: application/json'
GOLANG:
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://sanjuanpuertorico.org/api/v1/traffic"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
}