cre8-it/creatorsapi-laravel
最新稳定版本:v1.0.0
Composer 安装命令:
composer require cre8-it/creatorsapi-laravel
包简介
Laravel wrapper for amazon creatorsapi-php-sdk
README 文档
README
Small Laravel wrapper around the Amazon Creators API PHP SDK.
Requirements
- PHP 8.1+
- Laravel 9-12
Configuration
Publish the config:
php artisan vendor:publish --tag=creatorsapi-config
Environment options:
CREATORSAPI_CREDENTIAL_ID=
CREATORSAPI_CREDENTIAL_SECRET=
CREATORSAPI_CREDENTIAL_VERSION=
CREATORSAPI_AUTH_ENDPOINT=
CREATORSAPI_HOST=https://creatorsapi.amazon
CREATORSAPI_USER_AGENT=creatorsapi-laravel
CREATORSAPI_DEBUG=false
CREATORSAPI_DEBUG_FILE=php://output
CREATORSAPI_TEMP_FOLDER=
CREATORSAPI_HTTP_TIMEOUT=30
CREATORSAPI_HTTP_CONNECT_TIMEOUT=10
CREATORSAPI_HTTP_PROXY=
CREATORSAPI_HTTP_VERIFY=true
Usage
Examples below follow the SDK samples (SampleSearchItems.php, SampleGetItems.php), adapted for Laravel with fluent chaining.
SearchItems
use CreatorsApi\Laravel\Facades\CreatorsApi; use Amazon\CreatorsAPI\v1\com\amazon\creators\model\SearchItemsResource; use Amazon\CreatorsAPI\v1\ApiException; try { $response = CreatorsApi::searchItems() ->marketplace('www.amazon.com') ->partnerTag('yourtag-20') ->keywords('Harry Potter') ->searchIndex('Books') ->itemCount(2) ->resources([ SearchItemsResource::IMAGES_PRIMARY_MEDIUM, SearchItemsResource::ITEM_INFO_TITLE, SearchItemsResource::OFFERS_V2_LISTINGS_AVAILABILITY, SearchItemsResource::OFFERS_V2_LISTINGS_PRICE, ]) ->send(); } catch (ApiException $e) { report($e); }
GetItems
use CreatorsApi\Laravel\Facades\CreatorsApi; use Amazon\CreatorsAPI\v1\com\amazon\creators\model\GetItemsResource; use Amazon\CreatorsAPI\v1\ApiException; try { $response = CreatorsApi::getItems() ->marketplace('www.amazon.com') ->partnerTag('yourtag-20') ->itemIds(['B0DLFMFBJW', 'B0BFC7WQ6R', 'B00ZV9RDKK']) ->resources([ GetItemsResource::IMAGES_PRIMARY_MEDIUM, GetItemsResource::ITEM_INFO_TITLE, GetItemsResource::ITEM_INFO_FEATURES, GetItemsResource::OFFERS_V2_LISTINGS_PRICE, GetItemsResource::OFFERS_V2_LISTINGS_AVAILABILITY, ]) ->send(); } catch (ApiException $e) { report($e); }
统计信息
- 总下载量: 25
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2026-02-13