{"id":21556965,"url":"https://github.com/cbzink/launchlibrary","last_synced_at":"2025-12-30T16:12:17.388Z","repository":{"id":54049396,"uuid":"521982076","full_name":"cbzink/launchlibrary","owner":"cbzink","description":"An unofficial PHP SDK for Launch Library 2.","archived":true,"fork":false,"pushed_at":"2022-08-06T17:48:59.000Z","size":46,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-14T13:31:34.735Z","etag":null,"topics":["launchlibrary","php"],"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/cbzink.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2022-08-06T15:22:53.000Z","updated_at":"2024-11-17T17:23:26.000Z","dependencies_parsed_at":"2022-08-13T06:20:24.187Z","dependency_job_id":null,"html_url":"https://github.com/cbzink/launchlibrary","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/cbzink/launchlibrary","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbzink%2Flaunchlibrary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbzink%2Flaunchlibrary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbzink%2Flaunchlibrary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbzink%2Flaunchlibrary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cbzink","download_url":"https://codeload.github.com/cbzink/launchlibrary/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cbzink%2Flaunchlibrary/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265521415,"owners_count":23781500,"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":["launchlibrary","php"],"created_at":"2024-11-24T08:10:30.598Z","updated_at":"2025-12-13T12:23:39.301Z","avatar_url":"https://github.com/cbzink.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Launch Library 2 SDK for PHP\n\n\u003ca href=\"https://github.com/cbzink/launchlibrary/actions\"\u003e\u003cimg src=\"https://github.com/cbzink/launchlibrary/workflows/tests/badge.svg\" alt=\"Build Status\"\u003e\u003c/a\u003e \u003ca href=\"https://packagist.org/packages/cbzink/launchlibrary\"\u003e\u003cimg src=\"https://img.shields.io/packagist/v/cbzink/launchlibrary\" alt=\"Latest Stable Version\"\u003e\u003c/a\u003e \u003ca href=\"https://packagist.org/packages/cbzink/launchlibrary\"\u003e\u003cimg src=\"https://img.shields.io/packagist/dt/cbzink/launchlibrary\" alt=\"Total Downloads\"\u003e\u003c/a\u003e \u003ca href=\"https://packagist.org/packages/cbzink/launchlibrary\"\u003e\u003cimg src=\"https://img.shields.io/packagist/l/cbzink/launchlibrary\" alt=\"License\"\u003e\u003c/a\u003e\n\nA simple SDK for interacting with the [Launch Library 2 API](https://thespacedevs.com/llapi).\n\n## Table of Contents\n\n\u003cdetails\u003e\n  \u003csummary\u003eView the table of contents.\u003c/summary\u003e\n\n  \u003cbr /\u003e\n\n  - [Launch Library 2 SDK for PHP](#launch-library-2-sdk-for-php)\n    * [Requirements](#requirements)\n    * [Installation](#installation)\n    * [Usage](#usage)\n        + [Setup](#setup)\n            - [Pagination limits](#pagination-limits)\n        + [Resources](#resources)\n        + [Searching for resources](#searching-for-resources)\n            - [Pagination](#pagination)\n        + [Retrieving resources](#retrieving-resources)\n        + [Special cases](#special-cases)\n            - [Events and Launches](#events-and-launches)\n        + [Spacecraft](#spacecraft)\n  * [Acknowledgements](#acknowledgements)\n  * [License](#license)\n\u003c/details\u003e\n\n## Requirements\n\n* PHP \u003e= 7.4\n* A LL2 API token _(Optional)_\n\n## Installation\n\nInstall this library via [Composer](https://getcomposer.org/).\n\n```\ncomposer require cbzink/launchlibrary\n```\n\n## Usage\n\n### Setup\n\nInstantiate an instance of the LL2 class\n\n```php\nuse cbzink\\LaunchLibrary\\LL2;\n\n$client = new LL2($apiToken, $apiEndpoint);\n```\n\n| Parameter | Required? | Description |\n|--|--|--|\n| `$apiToken` | No | Provide your own API token for increased rate limits. Default none.|\n| `$apiEndpoint` | No | Provide an alternate API endpoint for switching between prod and dev environments. Default production.\n\n#### Pagination limits\n\nYou can change the pagination limit (default `10`) using `setPaginationLimit`.\n\n```php\n$client-\u003esetPaginationLimit(30);\n\n$client-\u003egetPaginationLimit() // (int) 30\n```\n\n### Resources\n\nCurrently available resources include Agencies, Astronauts, Docking Events, Events, Expeditions, Launchers, Launches, Locations, Pads, Space Stations, and Spacecraft.\n\n### Searching for resources\n\nYou can search for resources using the parameters specified in the [LL2 API docs](https://ll.thespacedevs.com/2.2.0/swagger/).\n\n```php\n$results = $client-\u003eagencies()-\u003esearch([\n    'country_code' =\u003e 'US',\n]);\n```\n\n#### Pagination\n\nSearches are often paginated. An array of resources is available under the `results` property, and `next()` and `previous()` methods are available for moving through pagination.\n\n```php\n$agencies = $client-\u003eagencies()-\u003esearch();\n\n// Array of Agency resources.\n$resources = $agencies-\u003eresults;\n\n// Fetch the next page of results\n$agencies = $agencies-\u003enext();\n```\n\n### Retrieving resources\n\nYou can retrieve detailed resources by their ID.\n\n```php\n$results = $client-\u003eagencies()-\u003efetch(123);\n```\n\n### Special cases\n\n#### Events and Launches\n\nEvents and Launches have additional Previous and Upcoming endpoints you can access using the SDK. `search()` and `fetch()` are available on both.\n\n```php\n// Previous\n$results = $client-\u003eevents()-\u003eprevious()-\u003esearch();\n\n// Upcoming\n$results = $client-\u003elaunches()-\u003eupcoming()-\u003esearch();\n```\n\n### Spacecraft\n\nSpacecraft have an additional Flights endpoint you can access using the SDK. `search()` and `fetch()` are available on both.\n\n```php\n$results = $client-\u003espacecraft()-\u003eflights()-\u003esearch();\n```\n\n## Acknowledgements\n\nInspiration for the design of this SDK was taken from [laravel/forge-sdk](https://github.com/laravel/forge-sdk) and [KnpLabs/php-github-api](https://github.com/KnpLabs/php-github-api).\n\n## License\n\nLaunch Library 2 SDK for PHP is open source software licensed under the [MIT license](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbzink%2Flaunchlibrary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcbzink%2Flaunchlibrary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcbzink%2Flaunchlibrary/lists"}