Skip to main content

PS4 2nd Screen Python Library

Project description


|BuildStatus| |PypiVersion| |PyPiPythonVersions| |CodeCov|



A full Python implementation based on the Node.js package, ps4-waker, which is an unofficial API for the PS4 2nd Screen App.

This module is mainly targeted towards developers although the module does include a basic CLI.

Disclaimer: This project/module and I are not affiliated with or endorsed by Sony Interactive Entertainment LLC. As such this project may break at any time.


This module can perform almost every feature found in the PS4 Second Screen App.

  • PS4 power and playing media state/status reporting
  • Remote control
  • Power on and standby control
  • Starting a specific game/media
  • Media information retrieval from the Playstation Store


Tested on:

  • Environment: Python 3.6/3.7/3.8

  • Operating System: Debian


Package can be installed with pip or from source.

It is advised to install the module in a virtual env.

Create virtual env first:

.. code:: bash

python -m venv .
source bin/activate

To install from pip:

.. code:: bash

pip install pyps4-2ndscreen

To install from source clone this repository and run from top-level:

.. code:: bash

pip install -r requirements.txt
python install


UDP is used to get status updates and retrieve user credentials. TCP is used to send commands to the PS4 Console.


This module uses UDP port 1987 by default as the source port for polling the PS4.

PS4 listens on ports 987 (Priveleged) to fetch user PSN credentials.

In order to obtain user credentials, the Python Interpreter needs access to port 987 on the host system. The credential service pretends to be a PS4 console and will receive broadcast packets from the PS4 2nd Screen app on port 987.


.. code:: bash

sudo setcap 'cap_net_bind_service=+ep' /usr/bin/python3.5

This is so you do not need sudo/root priveleges to run.

Cover Art Issues

If you find that media art cannot be found. Please post an issue with your Region, Country, Title of game, an ID of game.

Known Issues

  • PS Command inconsistent.
  • On-Screen Keyboard is not implemented.


Thanks to hthiery for writing the underlying socket protocol in Python.


.. |BuildStatus| image:: :target: .. |PyPiVersion| image:: :target: .. |PyPiPythonVersions| image:: :alt: Python versions :target: .. |Docs| image:: :target: :alt: Documentation Status .. |CodeCov| image::
:target: :alt: Code Coverage

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyps4-2ndscreen, version 1.3.1
Filename, size File type Python version Upload date Hashes
Filename, size pyps4_2ndscreen-1.3.1.tar.gz (41.9 kB) File type Source Python version None Upload date Hashes View
Filename, size pyps4_2ndscreen-1.3.1-py3-none-any.whl (44.3 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page