{"id":40488984,"url":"https://github.com/davesweb/bricklink-api","last_synced_at":"2026-01-20T18:49:55.580Z","repository":{"id":40463521,"uuid":"394367392","full_name":"davesweb/bricklink-api","owner":"davesweb","description":"A PHP SDK for the Bricklink API","archived":false,"fork":false,"pushed_at":"2023-05-06T08:51:57.000Z","size":170,"stargazers_count":6,"open_issues_count":4,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-10-04T01:59:42.112Z","etag":null,"topics":["api","bricklink","php"],"latest_commit_sha":null,"homepage":"https://davesweb.github.io/bricklink-api/","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/davesweb.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-09T16:39:22.000Z","updated_at":"2025-05-23T06:51:07.000Z","dependencies_parsed_at":"2022-08-21T08:20:55.307Z","dependency_job_id":null,"html_url":"https://github.com/davesweb/bricklink-api","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/davesweb/bricklink-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davesweb%2Fbricklink-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davesweb%2Fbricklink-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davesweb%2Fbricklink-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davesweb%2Fbricklink-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davesweb","download_url":"https://codeload.github.com/davesweb/bricklink-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davesweb%2Fbricklink-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28609209,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T16:10:39.856Z","status":"ssl_error","status_checked_at":"2026-01-20T16:10:39.493Z","response_time":117,"last_error":"SSL_read: 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","bricklink","php"],"created_at":"2026-01-20T18:49:54.896Z","updated_at":"2026-01-20T18:49:55.565Z","avatar_url":"https://github.com/davesweb.png","language":"PHP","funding_links":["https://www.patreon.com/davesweb"],"categories":[],"sub_categories":[],"readme":"# Bricklink API\n\nA PHP SDK for the Bricklink API. This package provides an easy way to authenticate with the Bricklink API, so you can run \nrequests directly against the Bricklink API. This package also provides some repositories for easier and object-oriented \ncommunication with the Bricklink API.\n\n## Installation\n\n`composer require davesweb/bricklink-api`\n\n## Usage\n\nThe following examples are just the basic usage of how to set up this package. Please read the \n[complete documentation](https://davesweb.github.io/bricklink-api/) for more detailed and advanced examples of how to \nuse this package and how to extend this package.\n\n### Authentication\n\nFirst, create a config object with your secrets and tokens you got from Bricklink.\n\n```php\n\u003c?php\n\nuse Davesweb\\BrinklinkApi\\BricklinkConfig;\n\n$config = new BricklinkConfig('consumerKey', 'consumerSecret', 'tokenValue', 'tokenSecret');\n```\n\nOptionally you may pass the API URL as a fifth parameter in case this ever changes, but by default this is set \ncorrectly.\n\nNext create a Bricklink Gateway object with the config you just made.\n\n```php\n\u003c?php\n\nuse Davesweb\\BrinklinkApi\\Bricklink;\nuse Davesweb\\BrinklinkApi\\BricklinkConfig;\n\n$config = new BricklinkConfig('consumerKey', 'consumerSecret', 'tokenValue', 'tokenSecret');\n\n$gateway = new Bricklink($config);\n```\n\nYou can now call the `request()` method on the gateway object to make direct requests to your shop. However you can also\nuse the repositories for easier data manipulation.\n\n### Repositories\n\nThis package provides a set of repositories that mimic the API structure of Bricklink. There are 14 repositories you can use:\n\n- `CategoryRepository`\n- `ColorRepository`\n- `CouponRepository`\n- `FeedbackRepository`\n- `InventoryRepository`\n- `ItemRepository`\n- `MappingRepository`\n- `MemberRepository`\n- `NotificationRepository`\n- `OrderRepository`\n- `PriceGuideRepository`\n- `SettingRepository`\n- `SubsetRepository`\n- `SupersetRepoository`\n\nEach repository requires a `Gateway` object to connect to Bricklink, and a `Transformer` object to transform the raw \ndata into value objects. Some repositories may require multiple transformers because they transform multiple things, \nlike the `OrderRepository`. A simple example is:\n\n```php\n\u003c?php\n\nuse Davesweb\\BrinklinkApi\\Bricklink;\nuse Davesweb\\BrinklinkApi\\BricklinkConfig;\nuse Davesweb\\BrinklinkApi\\Repositories\\ColorRepository;\nuse Davesweb\\BrinklinkApi\\Transformers\\ColorTransformer;\n\n$config = new BricklinkConfig('consumerKey', 'consumerSecret', 'tokenValue', 'tokenSecret');\n$gateway = new Bricklink($config);\n\n$repository = new ColorRepository($gateway, new ColorTransformer());\n\n$color = $repository-\u003efind(1);\n\nvar_dump($color);\n```\n\n## Documentation\n\nPlease read the [documentation](https://davesweb.github.io/bricklink-api/) for more detailed and advanced examples \nof how to use this package.\n\n## Docker\n\nThis package contains a Docker setup te easily run the tests and CS fixer.\n\nTo build the docker image, copy the docker compose file:\n\n`cp docker-compose.yml.dist docker-compose.yml`\n\nThen run:\n\n`docker-compose build`\n\nTo start the container, run: \n\n`docker-compose up -d`\n\nLogging in to the docker container:\n\n`docker-compose exec app bash`\n\n## Tests\n\nTo run the test suite, run `composer test` from inside the docker container, or `docker-compose exec app composer test` \nfrom outside the docker container. Tests are created using PHPUnit, so you may use PHPUnit and it's options directly to \nrun the tests.\n\n## Code style\n\nThis project uses [CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer) to enforce a unified code style. The \nconfiguration for this can be found in the `.php-cs-fixer.php` file.\n\nTo run CS fixer on the entire project, run `composer cs-fixer` from inside the container, or \n`docker-compose exec app composer cs-fixer` from outside the docker container. You can also run CS fixer directly \n(`php vendor/bin/php-cs-fixer fix`) and add your custom arguments. Keep in mind that the contributing guide \nrequires you to run CS Fixer with the configuration in this package.\n\n## License\n\nThis package is licensed under the MIT license, which basically means you can do whatever your want with this package. However, if you found this package useful, please consider buying me a beer or subscribing to premium email support over on [Patreon](https://www.patreon.com/davesweb), it's really appreciated!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavesweb%2Fbricklink-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavesweb%2Fbricklink-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavesweb%2Fbricklink-api/lists"}