{"id":15578535,"url":"https://github.com/mrt1m/playstation-store-api","last_synced_at":"2025-11-02T09:30:35.871Z","repository":{"id":57021144,"uuid":"379605757","full_name":"mrt1m/playstation-store-api","owner":"mrt1m","description":"A simple wrapper for working with PlayStation Store API 🎮","archived":false,"fork":false,"pushed_at":"2024-08-18T13:36:30.000Z","size":42,"stargazers_count":53,"open_issues_count":3,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-10T21:14:28.965Z","etag":null,"topics":["api-client","php8","playstation","playstation-store"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrt1m.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-23T13:05:19.000Z","updated_at":"2025-01-13T08:50:23.000Z","dependencies_parsed_at":"2024-01-11T19:00:04.026Z","dependency_job_id":"33c4b8dd-7874-4857-9caf-a4cb8e58de9e","html_url":"https://github.com/mrt1m/playstation-store-api","commit_stats":{"total_commits":10,"total_committers":3,"mean_commits":"3.3333333333333335","dds":"0.30000000000000004","last_synced_commit":"b03a7a63c056477a29af7b4683a602b376904095"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrt1m%2Fplaystation-store-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrt1m%2Fplaystation-store-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrt1m%2Fplaystation-store-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrt1m%2Fplaystation-store-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrt1m","download_url":"https://codeload.github.com/mrt1m/playstation-store-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239389508,"owners_count":19630312,"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-client","php8","playstation","playstation-store"],"created_at":"2024-10-02T19:11:22.692Z","updated_at":"2025-11-02T09:30:35.817Z","avatar_url":"https://github.com/mrt1m.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# playstation-store-api\n\n## 1. Prerequisites\n\n* PHP 8.1 or later\n\n## 2. Installation\n\nThe playstation-store-api can be installed using Composer by running the following command:\n\n```sh\ncomposer require mrt1m/playstation-store-api\n```\n\n## 3. Initialization\n\nCreate Client object using the following code:\n\n```php\n\u003c?php\ndeclare(strict_types=1);\n\nuse PlaystationStoreApi\\Client;\nuse GuzzleHttp\\Client as HTTPClient;\nuse PlaystationStoreApi\\Enum\\CategoryEnum;\nuse PlaystationStoreApi\\Enum\\RegionEnum;\n\nrequire_once __DIR__ . '/../vendor/autoload.php';\n\nconst API_URL = 'https://web.np.playstation.com/api/graphql/v1/';\n\n$client = new Client(RegionEnum::UNITED_STATES, new HTTPClient(['base_uri' =\u003e API_URL, 'timeout' =\u003e 5]));\n```\n\n## 4. API Requests\n\n### 4.1. Request product data by id\n\n```php\nuse PlaystationStoreApi\\Request\\RequestProductById;\n\n/**\n * Example for https://store.playstation.com/en-us/product/UP0001-CUSA09311_00-GAME000000000000\n */\n$response = $client-\u003eget(new RequestProductById('UP0001-CUSA09311_00-GAME000000000000'));\n```\n\n### 4.2. Request concept data by id\n\n```php\nuse PlaystationStoreApi\\Request\\RequestConceptById;\n\n/**\n Example for https://store.playstation.com/en-us/concept/10002694\n */\n$response = $client-\u003eget(new RequestConceptById('10002694'));\n```\n\n### 4.3. Request catalog data\n\n```php\nuse PlaystationStoreApi\\Request\\RequestProductList;\n\n$request = RequestProductList::createFromCategory(CategoryEnum::PS5_GAMES);\n\n$firstPageResponse = $client-\u003eget($request);\n\n$nextPageResponse = $client-\u003eget($request-\u003ecreateNextPageRequest());\n```\n\n## 5. Run examples\n\nIf you want run [examples](./examples), you need:\n1) Docker and docker compose\n2) Execute make command for example:\n```bash\nmake get_add_ons_by_title_id\n```\n3) Get api response from [response](./response) directory\n\n## 5. About request signing\n\nFor all request you need send sha256Hash. It's request signature.\n\nYou can get sha256Hash from browser request:\n1) Open the Network panel and find query to https://web.np.playstation.com/api/graphql/v1/op\n2) Copy the full request URL and use urldecode\n3) sha256Hash is in the extensions parameter, example:\n\n```\nhttps://web.np.playstation.com/api/graphql/v1/op?operationName=categoryGridRetrieve\u0026variables={\"id\":\"44d8bb20-653e-431e-8ad0-c0a365f68d2f\",\"pageArgs\":{\"size\":24,\"offset\":0},\"sortBy\":{\"name\":\"productReleaseDate\",\"isAscending\":false},\"filterBy\":[],\"facetOptions\":[]}\u0026extensions={\"persistedQuery\":{\"version\":1,\"sha256Hash\":\"9845afc0dbaab4965f6563fffc703f588c8e76792000e8610843b8d3ee9c4c09\"}}\n```\nIf default sha256Hash will be blocked, you can replace the base value:\n1) Get new sha256Hash value\n2) Replace the default value in ``PlaystationStoreApi\\RequestLocatorService``\n```php\nuse PlaystationStoreApi\\RequestLocatorService;\nuse PlaystationStoreApi\\Request\\RequestPSPlusTier;\n\n$customRequestLocatorService = RequestLocatorService::default();\n$customRequestLocatorService-\u003eset(RequestPSPlusTier::class, 'new sha256Hash value')\n```\n3) Give $customRequestLocatorService to client\n```php\ndeclare(strict_types=1);\n\nuse PlaystationStoreApi\\Client;\nuse GuzzleHttp\\Client as HTTPClient;\nuse PlaystationStoreApi\\Enum\\CategoryEnum;\nuse PlaystationStoreApi\\Enum\\RegionEnum;\n\nconst API_URL = 'https://web.np.playstation.com/api/graphql/v1/';\n\n$client = new Client(\n    RegionEnum::UNITED_STATES, \n    new HTTPClient(['base_uri' =\u003e API_URL, 'timeout' =\u003e 5]), \n    $customRequestLocatorService\n);\n```\n\n## 6. Custom request\n\nIf you need custom request:\n1) Create new request class then implement ``PlaystationStoreApi\\Request\\BaseRequest``\n2) Append new request class with sha256Hash to ``PlaystationStoreApi\\RequestLocatorService``\n3) Give new RequestLocatorService to client\n4) Execute client ``get`` method with new request\n\n## 7. Postman collection\n\nYou can try playstation api with [postman](https://www.postman.com/).\n\nFor import collection download [playstation api.postman_collection.json](./postman_collection/playstation%20api.postman_collection.json)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrt1m%2Fplaystation-store-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrt1m%2Fplaystation-store-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrt1m%2Fplaystation-store-api/lists"}