{"id":19588110,"url":"https://github.com/isfakeaccount/psnawp","last_synced_at":"2025-05-16T09:05:03.559Z","repository":{"id":40633748,"uuid":"340262828","full_name":"isFakeAccount/psnawp","owner":"isFakeAccount","description":"PlayStation Network API Python","archived":false,"fork":false,"pushed_at":"2025-05-16T04:21:52.000Z","size":4664,"stargazers_count":133,"open_issues_count":5,"forks_count":24,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-16T04:31:29.936Z","etag":null,"topics":["api","api-wrapper","playstation","playstation-network","psnawp","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/PSNAWP/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/isFakeAccount.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-02-19T04:57:32.000Z","updated_at":"2025-05-15T22:34:49.000Z","dependencies_parsed_at":"2024-05-19T08:27:08.481Z","dependency_job_id":"820e8909-a7ed-4de8-845c-8104096ec752","html_url":"https://github.com/isFakeAccount/psnawp","commit_stats":{"total_commits":260,"total_committers":4,"mean_commits":65.0,"dds":0.3730769230769231,"last_synced_commit":"2a4ea72138feaa251bd57516424615154ae73a32"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isFakeAccount%2Fpsnawp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isFakeAccount%2Fpsnawp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isFakeAccount%2Fpsnawp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isFakeAccount%2Fpsnawp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isFakeAccount","download_url":"https://codeload.github.com/isFakeAccount/psnawp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254501557,"owners_count":22081528,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","api-wrapper","playstation","playstation-network","psnawp","python"],"created_at":"2024-11-11T08:11:29.766Z","updated_at":"2025-05-16T09:04:58.535Z","avatar_url":"https://github.com/isFakeAccount.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg src=\"docs/_static/psn_logo.png\" alt=\"PlayStation Logo\" height=\"35px\"\u003e PlayStation Network API Wrapper Python (PSNAWP)\r\n\r\nRetrieve User Information, Trophies, Game and Store data from the PlayStation Network.\r\n\r\n[![PyPI version](https://badge.fury.io/py/PSNAWP.svg)](https://badge.fury.io/py/PSNAWP)\r\n[![Downloads](https://static.pepy.tech/badge/psnawp)](https://www.pepy.tech/projects/psnawp)\r\n[![python-logo](https://img.shields.io/badge/python-3.10_|_3.11_|_3.12_|_3.13-blue.svg)](https://www.python.org/)\r\n[![Checked with pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)\r\n[![Documentation Status](https://readthedocs.org/projects/psnawp/badge/?version=latest)](https://psnawp.readthedocs.io/en/latest/?badge=latest)\r\n[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)\r\n[![pre-commit](https://github.com/isFakeAccount/psnawp/actions/workflows/pre-commit.yaml/badge.svg)](https://github.com/isFakeAccount/psnawp/actions/workflows/pre-commit.yaml)\r\n[![pytest](https://github.com/isFakeAccount/psnawp/actions/workflows/pytest.yaml/badge.svg)](https://github.com/isFakeAccount/psnawp/actions/workflows/pytest.yaml)\r\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/license/MIT)\r\n\r\n\u003c!-- Pytest Coverage Comment:Begin --\u003e\n\\n\u003c!-- Pytest Coverage Comment:End --\u003e\n\r\n## How to install\r\n\r\n### From PyPI\r\n\r\n```\r\npip install PSNAWP\r\n```\r\n\r\n## Important Links\r\n\u003e PyPI: https://pypi.org/project/PSNAWP/\r\n\u003e\r\n\u003e Read the Docs: https://psnawp.readthedocs.io/en/latest/\r\n\r\n## Getting Started\r\n\r\n\u003e [!CAUTION]\r\n\u003e This library is an unofficial and reverse-engineered API wrapper for the PlayStation Network (PSN). It has been developed based on the reverse engineering of the PSN Android app. The API wrapper (\u003e= v2.1.0) will self rate limit at 300 requests per 15 minutes. However, it is still important that you don't send bulk requests using this API. Excessive use of API may lead to your PSN account being temporarily or permanently banned.\r\n\u003e\r\n\u003e You can also create a dedicated account to use this library so that in the worst-case scenario you do not lose access to your primary account, along with your video games and progress.\r\n\r\nTo get started you need to obtain npsso \u003c64 character code\u003e. You need to follow the following steps\r\n\r\n1. Login into your [My PlayStation](https://my.playstation.com/) account.\r\n2. In another tab, go to `https://ca.account.sony.com/api/v1/ssocookie`\r\n3. If you are logged in you should see a text similar to this\r\n\r\n```json\r\n{\"npsso\":\"\u003c64 character npsso code\u003e\"}\r\n```\r\nThis npsso code will be used in the api for authentication purposes. The refresh token that is generated from npsso lasts about 2 months. After that you have to get a new npsso token. The bot will print a warning if there are less than 3 days left in refresh token expiration.\r\n\r\nFollowing is the quick example on how to use this library\r\n\r\n```py\r\nfrom psnawp_api import PSNAWP\r\nfrom psnawp_api.models import SearchDomain\r\nfrom psnawp_api.models.trophies import PlatformType\r\n\r\npsnawp = PSNAWP(\"\u003c64 character npsso code\u003e\")\r\n\r\n# Your Personal Account Info\r\nclient = psnawp.me()\r\nprint(f\"Online ID: {client.online_id}\")\r\nprint(f\"Account ID: {client.account_id}\")\r\nprint(f\"Region: {client.get_region()}\")\r\nprint(f\"Profile: {client.get_profile_legacy()} \\n\")\r\n\r\n# Your Registered Devices\r\ndevices = client.get_account_devices()\r\nfor device in devices:\r\n    print(f\"Device: {device} \\n\")\r\n\r\n# Your Friends List\r\nfriends_list = client.friends_list()\r\nfor friend in friends_list:\r\n    print(f\"Friend: {friend} \\n\")\r\n\r\n# Your Players Blocked List\r\nblocked_list = client.blocked_list()\r\nfor blocked_user in blocked_list:\r\n    print(f\"Blocked User: {blocked_user} \\n\")\r\n\r\n# Your Friends in \"Notify when available\" List\r\navailable_to_play = client.available_to_play()\r\nfor user in available_to_play:\r\n    print(f\"Available to Play: {user} \\n\")\r\n\r\n# Your trophies (PS4)\r\nfor trophy in client.trophies(\"NPWR22810_00\", PlatformType.PS4):\r\n    print(trophy)\r\n\r\n# Your Chat Groups\r\ngroups = client.get_groups()\r\nfirst_group_id = None  # This will be used later to test group methods\r\nfor id, group in enumerate(groups):\r\n    if id == 0:  # Get the first group ID\r\n        first_group_id = group.group_id\r\n\r\n    group_info = group.get_group_information()\r\n    print(f\"Group {id}: {group_info} \\n\")\r\n\r\n# Your Playing time (PS4, PS5 above only)\r\ntitles_with_stats = client.title_stats()\r\nfor title in titles_with_stats:\r\n    print(\r\n        f\" \\\r\n        Game: {title.name} - \\\r\n        Play Count: {title.play_count} - \\\r\n        Play Duration: {title.play_duration} \\n\"\r\n    )\r\n\r\n\r\n# Other User's\r\nexample_user_1 = psnawp.user(online_id=\"VaultTec-Co\")  # Get a PSN player by their Online ID\r\nprint(f\"User 1 Online ID: {example_user_1.online_id}\")\r\nprint(f\"User 1 Account ID: {example_user_1.account_id}\")\r\nprint(f\"User 1 Region: {example_user_1.get_region()}\")\r\n\r\nprint(example_user_1.profile())\r\nprint(example_user_1.prev_online_id)\r\nprint(example_user_1.get_presence())\r\nprint(example_user_1.friendship())\r\nprint(example_user_1.is_blocked())\r\n\r\n# Example of getting a user by their account ID\r\nuser_account_id = psnawp.user(account_id=\"9122947611907501295\")\r\nprint(f\"User Account ID: {user_account_id.online_id}\")\r\n\r\n\r\n# Messaging and Groups Interaction\r\ngroup = psnawp.group(group_id=first_group_id)  # This is the first group ID we got earlier - i.e. the first group in your groups list\r\nprint(group.get_group_information())\r\nprint(group.get_conversation(10))  # Get the last 10 messages in the group\r\nprint(group.send_message(\"Hello World\"))\r\nprint(group.change_name(\"API Testing 3\"))\r\n# print(group.leave_group()) # Uncomment to leave the group\r\n\r\n# Create a new group with other users - i.e. 'VaultTec-Co' and 'test'\r\nexample_user_2 = psnawp.user(online_id=\"test\")\r\nnew_group = psnawp.group(users_list=[example_user_1, example_user_2])\r\nprint(new_group.get_group_information())\r\n# You can use the same above methods to interact with the new group - i.e. send messages, change name, etc.\r\n\r\n# Searching for Game Titles\r\nsearch = psnawp.search(search_query=\"GTA 5\", search_domain=SearchDomain.FULL_GAMES)\r\nfor search_result in search:\r\n    print(search_result[\"result\"][\"invariantName\"])\r\n\r\n ```\r\n\r\n**Note: If you want to create multiple instances of psnawp you need to get npsso code from separate PSN accounts. If you generate a new npsso with same account your previous npsso will expire immediately.**\r\n\r\n## Contribution\r\n\r\nAll bug reposts and features requests are welcomed, although I am new at making python libraries, so it may take me a while to implement some features. Suggestions are welcomes if I am doing something that is an unconventional way of doing it.\r\n\r\n## Disclaimer\r\n\r\nThis project was not intended to be used for spam, abuse, or anything of the sort. Any use of this project for those purposes is not endorsed. Please keep this in mind when creating applications using this API wrapper.\r\n\r\n## Credit\r\n\r\nThis project contains code from PlayStationNetwork::API and PSN-PHP Wrapper that was translated to Python. Also, special thanks @andshrew for documenting the PlayStation Trophy endpoints. All licenses are included in this repository.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisfakeaccount%2Fpsnawp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisfakeaccount%2Fpsnawp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisfakeaccount%2Fpsnawp/lists"}