Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
Yes. Roku TVs expose Roku’s documented External Control Protocol (ECP), an HTTP REST API on your local network, normally at port 8060. Use GET requests to read device and playback state, and empty-body POST requests to send keypresses, launch channels, change inputs, or control TV volume and power. You can find the TV with SSDP or configure its IP address manually, then call the same endpoints from curl, a server-side script, or JavaScript with fetch. Responses to query endpoints are XML, so JavaScript clients must parse XML rather than expect JSON. Which commands work depends on Roku OS settings: on Roku OS 14.1, mobile-app control must be enabled for common keypress and TV-query endpoints, while diagnostic commands require Developer Mode.
What is the Roku TV REST API?
Roku calls its local REST interface the External Control Protocol (ECP). Roku’s developer documentation defines it this way: “The External Control Protocol (ECP) enables a Roku device to be controlled over a local area network by providing a number of external control services.” The service runs over HTTP on the Roku device, normally on port 8060.
As an Amazon Associate I earn from qualifying purchases.
Free tools Windows power users keep installed
One-click scans. No signup required.
ECP is not a cloud API and it is not a Roku account API. A client on the same reachable LAN sends an HTTP request directly to the TV’s IP address. A typical base address is http://192.168.1.134:8060. The exact address changes with your network, and a TV may receive a different DHCP address after rebooting unless you reserve it in your router.
The API has two broad request types:
- GET requests read information, such as device metadata, media-player state, tuner channels, or the active TV channel.
- POST requests perform actions. ECP control examples use an empty request body, such as
curl -d '', for keypresses and app launches.
Queries return XML. ECP does not require a JavaScript SDK: browser or server-side JavaScript can use fetch with the documented HTTP methods and then parse the returned XML.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
What do I need before sending an ECP request?
You need a Roku TV that is reachable from the client, its current local IP address (or an SSDP discovery routine), and a client that can issue HTTP requests. Check these items before debugging individual commands:
- The computer, phone, or server and the TV are on the same LAN or on networks that permit traffic between them. Guest Wi-Fi isolation commonly prevents this.
- TCP port
8060is reachable at the Roku address. - On Roku OS 14.1, Settings > System > Advanced system settings > Control by mobile apps is set to Enabled for keypress and several TV-query functions.
- Your client uses the TV’s current IP address, not an old address cached from a previous DHCP lease.
- If you are calling from a browser, the page’s security policy permits a request to the TV. An HTTPS page generally cannot make an ordinary mixed-content request to an HTTP-only endpoint.
ECP is a local-network protocol. Do not treat port 8060 as an Internet service to publish through a router. Keep the TV and the controlling application on a trusted network and use firewall rules or network segmentation when the environment contains untrusted devices.
Recommended Free Tools
How do I find a Roku TV’s IP address with SSDP?
Roku advertises ECP through SSDP multicast at 239.255.255.250:1900. A discovery client sends an M-SEARCH request with ST: roku:ecp. Each Roku that answers returns headers including a Location URL, for example http://192.168.1.134:8060/. The host portion of that URL is the address to use for later ECP calls.
A discovery request has the following shape (line endings in an actual UDP packet are CRLF, followed by a blank line):
M-SEARCH * HTTP/1.1
HOST: 239.255.255.250:1900
MAN: "ssdp:discover"
ST: roku:ecp
MX: 3
Use a UDP socket in your chosen language to send that packet to the multicast address and listen for responses. Discovery can return more than one TV, so do not keep only the last response. Build a map keyed by each response’s USN and store its Location URL, then let the user select the intended device by name or address.
Roku documents Cache-Control: max-age=3600 on discovery responses. Treat a result as current for no longer than that advertised period; rediscover sooner when a request fails or when the user changes networks. SSDP depends on multicast, so it may fail across routed subnets or on Wi-Fi networks that suppress client-to-client multicast.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Should I use SSDP discovery or configure the IP address manually?
Use SSDP when devices move between networks or when you need to find several Rokus automatically. Use a configured address when you control the network and want the simplest, most predictable deployment.
| Approach | How it works | Advantages | Trade-offs |
|---|---|---|---|
| SSDP discovery | Send multicast M-SEARCH to 239.255.255.250:1900 with ST: roku:ecp; read each response’s Location URL. |
Finds the current address automatically; supports multiple devices. | Multicast may be blocked by Wi-Fi or routing; your UI must handle multiple replies and stale entries. |
| Manual IP | Store an address such as 192.168.1.134 and append :8060 to form the ECP base URL. |
Very little code; easy to test with curl. | DHCP changes can make the address stale unless the router reserves the lease. |
A practical application can support both: offer discovery first, allow manual entry as a fallback, and retain a selected device’s USN and location while periodically validating it.
How do I query a Roku TV with curl?
Set an environment variable for the TV’s address, then issue GET requests to the documented query endpoints. The following commands assume a Unix-like shell:
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
export ROKU_DEV_TARGET=192.168.1.134
curl "http://$ROKU_DEV_TARGET:8060/query/device-info"
curl "http://$ROKU_DEV_TARGET:8060/query/media-player"
/query/device-info reports device information in XML. /query/media-player reports the current media-player state, which is useful for determining whether content is playing and for identifying playback metadata exposed by the device. Save the response to inspect it with an XML-aware tool rather than assuming JSON:
curl -s "http://$ROKU_DEV_TARGET:8060/query/device-info" > device-info.xml
curl -s "http://$ROKU_DEV_TARGET:8060/query/media-player" > media-player.xml
For a quick connectivity check, a successful HTTP response from either endpoint confirms that the address and port are reachable. A timeout usually points to the wrong IP, network isolation, a sleeping or disconnected TV, or a firewall. An HTTP error after the connection succeeds is more likely to indicate an unsupported endpoint or a Roku setting requirement.
How do I send a keypress, keydown, or keyup from curl?
Send an empty-body POST to the corresponding path. The URL uses the key value as its final segment:
curl -d '' "http://$ROKU_DEV_TARGET:8060/keypress/home"
curl -d '' "http://$ROKU_DEV_TARGET:8060/keydown/left"
sleep 10
curl -d '' "http://$ROKU_DEV_TARGET:8060/keyup/left"
keypress represents a complete press. keydown starts a held key and keyup releases it, allowing software to model a long press. Always pair a successful keydown with a keyup, including in an error-handling path, so a navigation key is not left logically held.
Common navigation values include home and left. Roku TV-specific values use names such as VolumeUp and InputHDMI1; use the documented capitalization and spelling for those TV controls. A command can be tested without a script:
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchescurl -i -d '' "http://$ROKU_DEV_TARGET:8060/keypress/home"
The -i option displays the HTTP status and headers, which helps distinguish a transport problem from a rejected command.
How do I launch a Roku app or deep-link content?
Use a POST to the launch endpoint. For example, this request launches content with the supplied content identifier and media type:
curl -d '' "http://$ROKU_DEV_TARGET:8060/launch/dev?contentID=13234&MediaType=season"
The query-string parameters are part of the deep link. In shell scripts, quote the complete URL so characters such as & stay inside the URL rather than being interpreted by the shell. A launch request is an action, so use POST even though the parameters appear in the URL.
Which controls are specific to Roku TVs?
Roku TV models add television functions that are not meaningful on every Roku streaming player. The documented key values include:
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
| Key value | TV function |
|---|---|
VolumeDown |
Lower the TV volume. |
VolumeMute |
Toggle mute. |
VolumeUp |
Raise the TV volume. |
PowerOff |
Turn the television off. |
ChannelUp |
Move to the next tuner channel. |
ChannelDown |
Move to the previous tuner channel. |
InputTuner |
Select the built-in TV tuner. |
InputHDMI1 |
Select HDMI 1. |
InputHDMI2 |
Select HDMI 2. |
InputHDMI3 |
Select HDMI 3. |
InputHDMI4 |
Select HDMI 4. |
InputAV1 |
Select the AV input. |
Send these as keypress actions, for example:
curl -d '' "http://$ROKU_DEV_TARGET:8060/keypress/VolumeUp"
curl -d '' "http://$ROKU_DEV_TARGET:8060/keypress/InputHDMI1"
curl -d '' "http://$ROKU_DEV_TARGET:8060/keypress/PowerOff"
Whether a particular input exists depends on the physical ports and model. A command naming HDMI 4 cannot select a connector the television does not have.
How do I read tuner channels and the active channel?
Roku TV exposes tuner information through two GET endpoints:
curl "http://$ROKU_DEV_TARGET:8060/query/tv-channels"
curl "http://$ROKU_DEV_TARGET:8060/query/tv-active-channel"
/query/tv-channels returns the television’s tuner-channel data, while /query/tv-active-channel reports the channel currently selected by the tuner. Both responses are XML. These endpoints are useful for a channel browser or a status display, but they do not turn an external HDMI input into a tuner channel.
On Roku OS 14.1, Control by mobile apps must be enabled for query/tv-channels and query/tv-active-channel, just as it must be for keypress-related operations.
How do I call the Roku ECP from JavaScript?
The JavaScript equivalent of the curl pattern is a GET or POST to the same URL. The following example reads device information and then presses Home:
const rokuIp = '192.168.1.134';
const base = `http://${rokuIp}:8060`;
const infoResponse = await fetch(`${base}/query/device-info`);
if (!infoResponse.ok) {
throw new Error(`Device query failed: ${infoResponse.status}`);
}
const infoXml = await infoResponse.text();
const homeResponse = await fetch(`${base}/keypress/home`, {
method: 'POST',
body: ''
});
if (!homeResponse.ok) {
throw new Error(`Home keypress failed: ${homeResponse.status}`);
}
The empty string in body preserves ECP’s empty-body POST convention. Do not call response.json() for query endpoints; call response.text() and parse the XML.
How do I parse ECP’s XML response in JavaScript?
In a browser, use DOMParser. This example turns the returned XML document into a few readable values when the corresponding elements are present:
const parser = new DOMParser();
const xmlDocument = parser.parseFromString(infoXml, 'application/xml');
const parserError = xmlDocument.querySelector('parsererror');
if (parserError) {
throw new Error('Roku returned invalid XML');
}
const serialNumber = xmlDocument.querySelector('serial-number')?.textContent;
const modelName = xmlDocument.querySelector('model-name')?.textContent;
console.log({ serialNumber, modelName });
Element names and available fields vary by endpoint and Roku software version. Inspect the actual XML from the device and code defensively for missing elements. In Node.js or another server runtime, use the XML parser supported by that runtime; the HTTP contract remains the same.
Will browser JavaScript always be able to reach a Roku TV?
No. A browser page may be blocked even when curl works. The most common issue is mixed content: a page loaded over HTTPS is not normally allowed to fetch an HTTP URL such as http://192.168.1.134:8060. Browser origin and CORS rules can also affect direct requests to a device on a private address.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
For a browser-based remote, check the browser console first. If the request is blocked by mixed-content or cross-origin policy, put a small server-side component on the local network. The browser calls your HTTPS application, and that application performs the HTTP ECP request to the TV. A native desktop or mobile application can likewise make the local request outside browser-origin restrictions.
Do not “fix” this by exposing port 8060 to the public Internet. Keep the proxy and TV on a protected network, authenticate users at your application layer, and limit which destinations the proxy is allowed to contact.
Which Roku settings and OS versions change command availability?
Command support is controlled by Roku’s platform rules, not only by the URL syntax. As of Roku OS 14.1, set Settings > System > Advanced system settings > Control by mobile apps to Enabled for these operations:
keypresskeydownkeyupquery/iconquery/tv-channelsquery/tv-active-channel
Diagnostic and development-oriented endpoints, including query/chanperf, query/registry, query/app-state, and exit-app, additionally require Developer Mode. Do not enable Developer Mode merely to send ordinary navigation or TV-control commands.
Roku OS 12.0 removed the search command. A script written against older examples should not assume that endpoint still exists. Roku can change these requirements in future releases, so check the device’s current software behavior when deploying long-lived integrations.
| Situation | Likely result | Action |
|---|---|---|
| Mobile-app control disabled | Keypress or TV-query requests do not work as expected. | Enable Control by mobile apps in the documented settings path. |
| Diagnostic endpoint without Developer Mode | Diagnostic request is rejected or unavailable. | Use Developer Mode only when the diagnostic function is actually required. |
Script calls search on Roku OS 12.0 or later |
The command is unavailable. | Remove the dependency and use a supported discovery or application-specific flow. |
How should I handle errors and stale devices?
Separate network, HTTP, and protocol failures so your application can tell the user what to fix:
- Network timeout or connection refusal: verify the IP address, port 8060, Wi-Fi isolation, TV power state, and local firewall rules. Rediscover with SSDP if the address may have changed.
- HTTP response but unexpected status: confirm the endpoint spelling, method, key capitalization, and whether the command requires mobile-app control or Developer Mode.
- Successful query with missing XML fields: treat fields as optional and inspect the exact response from that model and OS version.
- Action appears to do nothing: verify that the request used POST with an empty body, that a key value is valid for the TV, and that the selected input or tuner function exists on the model.
- Discovery finds no devices: test a manually entered IP, confirm multicast is allowed on the LAN, and check that the client is not on an isolated guest network.
When a device disappears, discard its cached location after the discovery cache period or after a failed request, then run SSDP again. For a multi-TV installation, always display enough identity information for a person to distinguish rooms or sets before sending a power or input command.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
What is a sensible implementation pattern for a Roku remote?
A robust integration keeps discovery, transport, parsing, and UI state separate:
- Discover or select: collect SSDP responses, retain each USN and location, and let the user choose a TV. Permit manual IP entry.
- Normalize the base URL: store the scheme, host, and port once, then append endpoint paths without accidentally duplicating slashes.
- Wrap HTTP calls: provide one function for GET queries and one for empty-body POST actions. Apply timeouts and report status codes.
- Parse XML at the boundary: convert each response into application data immediately, while preserving the raw XML for diagnostics when appropriate.
- Model held keys safely: send
keydown, schedule a release, and guaranteekeyupif the user cancels or the request fails. - Refresh identity: rediscover after network changes, failed requests, or an expired
max-age=3600discovery result.
This design lets a command-line prototype and a browser or native remote share the same endpoint logic while using different discovery and security layers.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
What are the practical limits of ECP?
ECP is intentionally local and device-oriented. It is well suited to remote-control actions, status polling, input selection, and tuner information. It is not a replacement for a cloud content catalog, a cross-home control service, or a universal JSON SDK. Your integration must account for the specific Roku OS version and TV hardware, and it should not assume that a command documented for a Roku TV applies identically to every Roku streaming device.
Polling should be purposeful: query state after an action or at a user-visible refresh interval instead of generating unnecessary traffic. Keep the TV address private, avoid Internet exposure, and make failures recoverable through rediscovery rather than asking users to restart the entire application.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchHow do curl, browser JavaScript, and server-side JavaScript compare?
| Client | Best use | Strengths | Important caveat |
|---|---|---|---|
| curl | Testing, shell automation, and troubleshooting. | Direct visibility into URLs, methods, status codes, and raw XML. | Requires a known IP or a separate SSDP discovery program. |
| Browser JavaScript | A web interface running on a local or hosted page. | Interactive UI and straightforward fetch calls when browser policies allow them. |
HTTP-to-private-network requests can be blocked by mixed-content, origin, or browser security rules. |
| Server-side JavaScript | A local service, home-automation backend, or controlled proxy. | Can perform LAN requests without browser-origin restrictions and can centralize discovery. | The server must have LAN reachability and must protect its own control endpoint. |
All three clients use the same ECP contract: GET for queries, empty-body POST for actions, port 8060, and XML query responses.
What should I test first when building an integration?
Start with the smallest end-to-end sequence, then add discovery and richer controls:
- Confirm the TV address with SSDP or the TV’s network information screen.
- Run
curl "http://IP:8060/query/device-info"and verify that XML is returned. - Send
curl -d '' "http://IP:8060/keypress/home"with mobile-app control enabled. - Query
media-playerand inspect the XML fields your UI actually needs. - Add one TV-specific action, such as
InputHDMI1, then test tuner queries if the model has an antenna input. - Only after those calls work, implement SSDP caching, multi-device selection, held keys, and a browser-facing proxy.
This order isolates address and settings problems before they are hidden inside a larger application.
Frequently Asked Questions
Does a Roku TV REST API require an Internet connection?
No. ECP traffic is sent directly to the TV over the local network, so ordinary control and query requests do not depend on a cloud service. Internet access may still be needed by the TV for unrelated streaming or software functions.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Can I control several Roku TVs from one program?
Yes. SSDP can return multiple responses; keep a device record for each USN and location URL, present a room or device selector, and send requests to the selected address. Do not assume the first SSDP response is the intended television.
Why does my curl command work while my web page fails?
curl is not subject to browser mixed-content and origin enforcement. A page served over HTTPS may be blocked from fetching the TV’s HTTP endpoint, so use a local server-side proxy or a native application when browser policy prevents direct access.
Are ECP query responses JSON?
No. The documented query responses are XML. Read them as text and parse them with an XML parser such as the browser’s DOMParser, while allowing for fields that vary by endpoint, model, or Roku OS version.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Recommended Free Tools

