{"id":44019791,"url":"https://github.com/stuartmcgill/sumoapi-php","last_synced_at":"2026-02-07T16:08:53.689Z","repository":{"id":153376493,"uuid":"629104799","full_name":"stuartmcgill/sumoapi-php","owner":"stuartmcgill","description":"A PHP wrapper for https://sumo-api.com/","archived":false,"fork":false,"pushed_at":"2026-02-04T20:22:54.000Z","size":183,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-05T07:44:38.938Z","etag":null,"topics":["api","php","sumo"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stuartmcgill.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-04-17T16:18:35.000Z","updated_at":"2026-02-04T20:22:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"c571486e-a318-4c48-bd5d-332a798ae8c7","html_url":"https://github.com/stuartmcgill/sumoapi-php","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/stuartmcgill/sumoapi-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stuartmcgill%2Fsumoapi-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stuartmcgill%2Fsumoapi-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stuartmcgill%2Fsumoapi-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stuartmcgill%2Fsumoapi-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stuartmcgill","download_url":"https://codeload.github.com/stuartmcgill/sumoapi-php/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stuartmcgill%2Fsumoapi-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29199519,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T14:35:27.868Z","status":"ssl_error","status_checked_at":"2026-02-07T14:25:51.081Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","php","sumo"],"created_at":"2026-02-07T16:08:52.695Z","updated_at":"2026-02-07T16:08:53.684Z","avatar_url":"https://github.com/stuartmcgill.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sumo API (PHP)\n\n![Code coverage badge](https://github.com/stuartmcgill/sumoapi-php/blob/image-data/coverage.svg)\n\nThis library provides a PHP wrapper for https://sumo-api.com/. Currently the following functionality\nis available:\n\n- Fetch all rikishis\n- Fetch a rikishi by ID\n- Fetch a rikishi's matches\n- Fetch multiple rikishi (by IDs)\n- Fetch multiple rikishi (by division)\n- Fetch rikishi matchups\n- Fetch kimarite (by type)\n\n# Installation\n\n`composer require stuartmcgill/sumoapi-php`\n\n# Usage\n\nSee https://sumo-api.com/api-guide for details of the API endpoints.\n\n## Rikishi API\n\n### Sample code\n\n```php\n#!/bin/env php\n\u003c?php\n\ndeclare(strict_types=1);\n\nnamespace StuartMcGill\\SumoApiTester;\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\nuse StuartMcGill\\SumoApiPhp\\Model\\Rikishi;\nuse StuartMcGill\\SumoApiPhp\\Model\\RikishiMatch;\nuse StuartMcGill\\SumoApiPhp\\Service\\BashoService;\nuse StuartMcGill\\SumoApiPhp\\Service\\RikishiService;\n\n$bashoService = BashoService::factory();\n$rikishiService = RikishiService::factory();\n\n// Fetch rikishis from a particular basho\n$rikishisFromThePast = $bashoService-\u003efetchRikishiIdsByBasho(2019, 3, 'Makuuchi');\necho 'Rikishi IDs from March 2019 are ' . implode(',', $rikishisFromThePast) . \"\\n\";\n\n// Fetch a single rikishi\n$rikishi = $rikishiService-\u003efetch(1);\necho $rikishi-\u003eshikonaJp . \"\\n\";\n\n// Fetch all rikishis\n$rikishis = $rikishiService-\u003efetchAll();\n$totalMass = array_reduce(\n    array: $rikishis,\n    callback: static fn (float $total, Rikishi $rikishi) =\u003e $total + $rikishi-\u003eweight,\n    initial:0,\n);\necho \"The total mass of all the wrestlers is $totalMass kg\\n\";\n\n// Fetch all of a rikishi's matches\n$matches = $rikishiService-\u003efetchMatches(1);\n$oshidashiWins = array_filter(\n    array: $matches,\n    callback: static fn (RikishiMatch $match) =\u003e\n            $match-\u003ewinnerId === 1 \u0026\u0026 $match-\u003ekimarite === 'oshidashi',\n);\necho 'Takakeisho has won by Oshidashi ' . count($oshidashiWins) . \" times\\n\";\n\n// Fetch some rikishi (by IDs)\n$someRikishi = $rikishiService-\u003efetchSome([1, 2]);\necho 'Fetched details for ' . count($someRikishi) . \" wrestlers\\n\";\n\n// Fetch rikishi and filter by division\n$someRikishi = $rikishiService-\u003efetchDivision('Makuuchi');\necho 'Fetched details for ' . count($someRikishi) . \" Makuuchi wrestlers\\n\";\n\n// Fetch rikishi matchups (head-to-heads)\n$matchupSummary = $rikishiService-\u003efetchMatchups(1, [2]);\necho 'Takakeisho has fought Asanoyama ' . $matchupSummary-\u003ematchups[0]-\u003etotal() . ' times';\n```\n\n### Output\n```\nRikishi IDs from March 2019 are 3081,44,43,1,26,674,9,16,3195,637,47,23,2,35,673,15,51,102,67,368,48,39,3181,3249,14,27,17,36,33,46,10,22,25,3142,3120,106,38,3248,29,3204,30,636\n貴景勝　光信\nThe total mass of all the wrestlers is 83279.2 kg\nTakakeisho has won by Oshidashi 193 times\nFetched details for 2 wrestlers\nFetched details for 42 Makuuchi wrestlers\nTakakeisho has fought Asanoyama 9 times⏎   \n```\n\n## Kimarite API\n\n### Sample code\n\n```php\n#!/bin/env php\n\u003c?php\n\ndeclare(strict_types=1);\n\nnamespace StuartMcGill\\SumoApiTester;\n\nrequire __DIR__ . '/../vendor/autoload.php';\n\nuse StuartMcGill\\SumoApiPhp\\Service\\KimariteService;\n\n$kimariteService = KimariteService::factory();\n\n// Fetch last three matches where the kimarite was yorikiri\n$matches = $kimariteService-\u003efetchByType(type: 'yorikiri', sortOrder: 'desc', limit: 3, skip: 0);\nforeach ($matches as $match) {\n    $loser = $match-\u003eloserEn();\n    echo \"$match-\u003ewinnerEn defeated $loser by yorikiri in $match-\u003edivision \"\n        . \"on day $match-\u003eday of the $match-\u003ebashoId basho.\\n\";\n}\n```\n\n### Output\n```\nOnosato defeated Hiradoumi by yorikiri in Makuuchi on day 7 of the 202409 basho.\nSadanoumi defeated Shirokuma by yorikiri in Makuuchi on day 7 of the 202409 basho.\nRyuden defeated Kitanowaka by yorikiri in Makuuchi on day 7 of the 202409 basho.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstuartmcgill%2Fsumoapi-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstuartmcgill%2Fsumoapi-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstuartmcgill%2Fsumoapi-php/lists"}