Skip to content
Web proxy for SamyGO
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

SamyGO web API

The Web API exposes some of SamyGO's plugins to external clients. The API tries to return data in json format where possible, but uses image/jpg for screenshots.


  • Get TV State and current program details via libLogChannel
  • Control the TV via samyGOrc with remote actions
  • Reboot the TV
  • Get a screenshot of what is on the screen via libScreenShot
  • Start a widget via libRunWidget
  • Display an onscreen message via libAlert
  • Compatibility with libSoftPowerOff (



  • Download to your rooted SamyGO TV:
cd /tmp
curl -k >
  • Unzip
  • Run the installation script:

LibSoftPowerOff coexistence: If you have libSoftPowerOff enabled in your TV and you use the screenshot functionality, in order not to inject the screenshot command when the display is off you can signal that the TV is in soft-off mode by configuring to run two scripts on power on/off. When you load the libSoftPowerOff library, use the following options: CMD_ON:/mnt/scripts/ CMD_OFF:/mnt/scripts/ The scripts (among other functionality) should set a flag by creating a file called /dtv/tvIsSleeping:

  • rm -f /dtv/tvIsSleeping
  • touch /dtv/tvIsSleeping

If you don't use libSoftPowerOff, the TV powers off and the web API is no longer accessible.


/mnt/etc/init.d/99_99_samygo_web_api.init start
  • On first run the startup script will generate a unique challenge which will be printed by the startup screen. This challenge is generated in /mnt/etc/samygo-web-api.challenge. You will need to supply this challenge string on all requests. The security is equivalent to HTTP Simple Auth and should protect you against somebody scanning your system, but will not protect you from a man-in-the middle attack! Also, don't use over unencrypted internet!

API Usage:

  • to get the current information, request for action=CHANNELINFO:
$ wget -O - "http://tv-ip:1080/cgi-bin/samygo-web-api.cgi?challenge=oyd4uIz5WWAkWPo5MzfxBFraI05C3FDorSPE7xiMLCVAQ40a&action=CHANNELINFO"

{"source":"TV (0)","pvr_status":"NONE","powerstate":"Normal","tv_mode":"Cable (1)","volume":"9","channel_number":"45","channel_name":"Nat Geo HD","program_name":"Planeta dezastrelor","resolution":"1920x1080","error":false}
  • to reboot TV request for action=REBOOT:
$ wget -O - http://tv-ip:1080/cgi-bin/samygo-web-api.cgi?challenge=oyd4uIz5WWAkWPo5MzfxBFraI05C3FDorSPE7xiMLCVAQ40a&action=REBOOT
  • to shutdown TV request for action=SHUTDOWN:
$ wget -O - http://tv-ip:1080/cgi-bin/samygo-web-api.cgi?challenge=oyd4uIz5WWAkWPo5MzfxBFraI05C3FDorSPE7xiMLCVAQ40a&action=SHUTDOWN
  • to send key events request for action=KEY and key=KEY_1:
$ wget -O - http://tv-ip:1080/cgi-bin/samygo-web-api.cgi?challenge=oyd4uIz5WWAkWPo5MzfxBFraI05C3FDorSPE7xiMLCVAQ40a&action=KEY&key=KEY_1

{"error":false,"message":"Sent key 4"}

The list and codes of supported keys are available inside the script in the $KEYS array:

  • to get a snapshot from the TV request for action=SNAPSHOT:
$ wget -O /tmp/image.jpg http://tv-ip:1080/cgi-bin/samygo-web-api.cgi?challenge=oyd4uIz5WWAkWPo5MzfxBFraI05C3FDorSPE7xiMLCVAQ40a&action=SNAPSHOT
  • to run a widget on your TV request for action=WIDGET&name=YouTube (name is case-sensitive):
$ wget -O - http://tv-ip:1080/cgi-bin/samygo-web-api.cgi?challenge=oyd4uIz5WWAkWPo5MzfxBFraI05C3FDorSPE7xiMLCVAQ40a&action=WIDGET&name=YouTube
  • to display an onscreen message use action=ALERT&message=This+is+a+test&type=CENTER. You can also use blinks=4&delay=1000 to blink for 4 seconds:
$ wget -O - http://tv-ip:1080/cgi-bin/samygo-web-api.cgi?challenge=oyd4uIz5WWAkWPo5MzfxBFraI05C3FDorSPE7xiMLCVAQ40a&action=ALERT&type=CENTER&message=This+is+a+test
You can’t perform that action at this time.