{"id":13830409,"url":"https://github.com/rayblair06/SpaceTradersPHP","last_synced_at":"2025-07-09T11:32:59.106Z","repository":{"id":62533562,"uuid":"349578164","full_name":"rayblair06/SpaceTradersPHP","owner":"rayblair06","description":"An API Wrapper for spacetraders.io written in PHP","archived":false,"fork":false,"pushed_at":"2021-03-25T07:50:38.000Z","size":9,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-17T16:07:32.164Z","etag":null,"topics":["php","spacetraders"],"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/rayblair06.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-19T23:15:54.000Z","updated_at":"2023-05-26T19:23:44.000Z","dependencies_parsed_at":"2022-11-02T16:01:06.625Z","dependency_job_id":null,"html_url":"https://github.com/rayblair06/SpaceTradersPHP","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayblair06%2FSpaceTradersPHP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayblair06%2FSpaceTradersPHP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayblair06%2FSpaceTradersPHP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayblair06%2FSpaceTradersPHP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rayblair06","download_url":"https://codeload.github.com/rayblair06/SpaceTradersPHP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225539391,"owners_count":17485318,"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":["php","spacetraders"],"created_at":"2024-08-04T10:00:59.607Z","updated_at":"2024-11-20T11:30:45.303Z","avatar_url":"https://github.com/rayblair06.png","language":"PHP","funding_links":[],"categories":["V1 SDKs"],"sub_categories":[],"readme":"# SpacetradersPHP\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/rayblair/SpacetradersPHP.svg?style=flat-square)](https://packagist.org/packages/rayblair/SpacetradersPHP)\n[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/rayblair/SpacetradersPHP/Tests?label=tests)](https://github.com/rayblair/SpacetradersPHP/actions?query=workflow%3ATests+branch%3Amaster)\n[![Total Downloads](https://img.shields.io/packagist/dt/rayblair/SpacetradersPHP.svg?style=flat-square)](https://packagist.org/packages/rayblair/SpacetradersPHP)\n\nAn API Wrapper for spacetraders.io written in PHP.\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require rayblair/spacetradersphp\n```\n\n## Example\n\n```php\n    // Include composer autoload, if required\n    require __DIR__ . '/vendor/autoload.php';\n\n    // Import the SpaceTradersPHP class\n    use RayBlair\\SpaceTradersPHP\\SpaceTradersPHP;\n\n    // Initial a client instance\n    $client = new SpaceTradersPHP('token', 'username');\n\n    // Will return the game status\n    echo $client-\u003egame-\u003estatus()-\u003estatus;\n\n    // kill php script\n    die();\n```\n\n## Usage\n\n```php\n    // Include composer autoload, if required\n    require 'vendor/autoload.php';\n\n    // Import the SpaceTradersPHP class\n    use RayBlair\\SpaceTradersPHP\\SpaceTradersPHP;\n\n    // Initial a client instance\n    $client = new SpaceTradersPHP('token', 'username');\n\n    // Get Game Status\n    $client-\u003egame-\u003estatus();\n\n    // Create User Token\n    $client-\u003eusers-\u003etoken('username');\n\n    // Show User\n    $client-\u003eusers-\u003eget('username');\n\n    // Get All Active Flight Plans\n    $client-\u003eflightPlans-\u003eall('OE');\n\n    // Get existing Flight Plan\n    $client-\u003eflightPlans-\u003eget('username', 'flight_plan_id');\n\n    // Create Flight Plan\n    $client-\u003eflightPlans-\u003ecreate('username', 'ship_id', 'destination');\n\n    // Get available loans\n    $client-\u003eloans-\u003eall();\n\n    // Get loans\n    $client-\u003eloans-\u003eget('username');\n\n    // Takeout loan\n    $client-\u003eloans-\u003etakeout('username', 'STARTUP');\n\n    // Payoff loan\n    $client-\u003eloans-\u003epayoff('username', 'loan_id');\n\n    // Get Location\n    $client-\u003elocations-\u003eget('OE-UC');\n\n    // Get Ships at Location\n    $client-\u003elocations-\u003eships('OE-UC');\n\n    // Get Locations in System\n    $client-\u003esystems-\u003eall();\n\n    // Get Locations in System\n    $client-\u003esystems-\u003eget('OE');\n\n    // Get Marketplace in Location\n    $client-\u003elocations-\u003emarketplace('OE-UC');\n\n    // Purchase Order\n    $client-\u003eorders-\u003epurchase('username', 'ship_id', 'FUEL', 20);\n\n    // Sell Order\n    $client-\u003eorders-\u003esell('username', 'ship_id', 'FUEL', 20);\n\n    // Show All Ships\n    $client-\u003eships-\u003eall();\n\n    // Show Player's Ships\n    $client-\u003eships-\u003eget();\n\n    // Get Ship by ID\n    $client-\u003eships-\u003eget('ship_id');\n\n    // Purchase Ship\n    $client-\u003eships-\u003epurchase('username', 'OE-PM-TR', 'JW-MK-I');\n\n    // Jettison Ship's Cargo\n    $client-\u003eships-\u003ejettison('username', 'ship_id', 'FUEL', 20);\n\n    // Scrap Ship\n    $client-\u003eships-\u003escrap('username', 'ship_id');\n```\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.\n\n## Security Vulnerabilities\n\nPlease review [our security policy](../../security/policy) on how to report security vulnerabilities.\n\n## Credits\n\n-   [Ray Blair](https://github.com/rayblair06)\n-   [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frayblair06%2FSpaceTradersPHP","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frayblair06%2FSpaceTradersPHP","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frayblair06%2FSpaceTradersPHP/lists"}