PAC Control REST API
opto22 · IoT
#### Revised: 6/15/2018 ### Overview This API provides secure access to a SNAP-PAC-R or -S series controller's variable and I/O tags. Confidentiality for API transactions is provided by HTTPS. Authentication uses HTTP Basic Authentication with an API key. An API key ID is submitted in the Basic Authentication userid field and API key value in the password field. **For more information visit:** [developer.opto22.com](http://developer.opto22.com) ### Examples **Read an array** of all the integ
Authentication
Sample Requests
Returns controller's type; firmware version; both mac addresses; and uptime in seconds
Hover any highlighted part to learn what it does
curl -X GET "https://api.apis.guru/v2/specs/opto22.com/pac/R1.0a/device"
import requests
response = requests.get(
"https://api.apis.guru/v2/specs/opto22.com/pac/R1.0a/device",
)
print(response.json())const url = 'https://api.apis.guru/v2/specs/opto22.com/pac/R1.0a/device'; const response = await fetch(url); const data = await response.json(); console.log(data);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "https://api.apis.guru/v2/specs/opto22.com/pac/R1.0a/device"
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/opto22.com/pac/R1.0a/device")
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/opto22.com/pac/R1.0a/device";
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Returns the name, date, time, and CRC of the strategy currently in the controller, and the number of charts currently running. Empty strings and a 0 will be returned when there is no strategy.
Hover any highlighted part to learn what it does
curl -X GET "https://api.apis.guru/v2/specs/opto22.com/pac/R1.0a/device/strategy"
import requests
response = requests.get(
"https://api.apis.guru/v2/specs/opto22.com/pac/R1.0a/device/strategy",
)
print(response.json())const url = 'https://api.apis.guru/v2/specs/opto22.com/pac/R1.0a/device/strategy'; const response = await fetch(url); const data = await response.json(); console.log(data);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "https://api.apis.guru/v2/specs/opto22.com/pac/R1.0a/device/strategy"
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/opto22.com/pac/R1.0a/device/strategy")
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/opto22.com/pac/R1.0a/device/strategy";
$opts = ["http" => [
"method" => "GET",
]];
$ctx = stream_context_create($opts);
$res = file_get_contents($url, false, $ctx);
print_r(json_decode($res, true));Returns the name and engineering units (EU) for all analog input points in the strategy
Hover any highlighted part to learn what it does
curl -X GET "https://api.apis.guru/v2/specs/opto22.com/pac/R1.0a/device/strategy/ios/analogInputs"
import requests
response = requests.get(
"https://api.apis.guru/v2/specs/opto22.com/pac/R1.0a/device/strategy/ios/analogInputs",
)
print(response.json())const url = 'https://api.apis.guru/v2/specs/opto22.com/pac/R1.0a/device/strategy/ios/analogInputs'; const response = await fetch(url); const data = await response.json(); console.log(data);
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
targetURL := "https://api.apis.guru/v2/specs/opto22.com/pac/R1.0a/device/strategy/ios/analogInputs"
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/opto22.com/pac/R1.0a/device/strategy/ios/analogInputs")
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/opto22.com/pac/R1.0a/device/strategy/ios/analogInputs";
$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 PAC Control REST API?
PAC Control REST API is a IoT API. Developers commonly use iot APIs for:
- collecting and streaming sensor and device data
- monitoring and controlling connected devices
- building smart-home and industrial dashboards
- processing device telemetry at scale
- automating device provisioning and alerting
No authentication required. This API is open — no signup or key needed. Ideal for quick prototypes and public-facing features. PAC Control REST 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?