Download the PHP package pinterest/laravel-sdk without Composer
On this page you can find all versions of the php package pinterest/laravel-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pinterest/laravel-sdk
More information about pinterest/laravel-sdk
Files in pinterest/laravel-sdk
Package laravel-sdk
Short Description A Laravel-native SDK for the Pinterest API v5
License MIT
Homepage https://github.com/pinterest/laravel-sdk
Informations about the package laravel-sdk
Laravel Pinterest SDK
A Laravel-native SDK for the Pinterest API v5. Provides a clean, expressive interface for interacting with Pinterest's boards, pins, ads, and user accounts using Laravel's HTTP client.
Requirements
- PHP 8.2+
- Laravel 11.0+ or 12.0+
Installation
Install the package via Composer:
The service provider and facade are auto-discovered by Laravel.
Publish Configuration
This publishes config/pinterest.php to your application.
Configuration
Add the following to your .env file:
Full Configuration Options
| Key | Env Variable | Default | Description |
|---|---|---|---|
client_id |
PINTEREST_CLIENT_ID |
'' |
Pinterest App ID |
client_secret |
PINTEREST_CLIENT_SECRET |
'' |
Pinterest App Secret |
redirect_uri |
PINTEREST_REDIRECT_URI |
'' |
OAuth callback URL |
access_token |
PINTEREST_ACCESS_TOKEN |
'' |
Bearer access token |
refresh_token |
PINTEREST_REFRESH_TOKEN |
'' |
OAuth refresh token |
api_version |
PINTEREST_API_VERSION |
v5 |
API version |
base_url |
PINTEREST_BASE_URL |
https://api.pinterest.com |
API base URL |
oauth_url |
PINTEREST_OAUTH_URL |
https://www.pinterest.com/oauth/ |
OAuth URL |
scopes |
PINTEREST_SCOPES |
boards:read,pins:read,user_accounts:read |
OAuth scopes |
timeout |
PINTEREST_TIMEOUT |
30 |
Request timeout (seconds) |
retry.times |
- | 3 |
Max retry attempts |
retry.sleep |
- | 100 |
Retry delay (milliseconds) |
Usage
All API interactions are available through the Pinterest facade.
Boards
Pins
User Account
Pagination
Pinterest uses cursor-based pagination with bookmark tokens. The SDK handles this transparently:
OAuth Flow
The SDK provides a complete OAuth2 authorization code flow:
Ads API
All ads endpoints require an ad account ID:
Media Upload
Error Handling
The SDK throws typed exceptions for different error scenarios:
Working with Responses
All API calls return an ApiResponse (or PaginatedResponse for list endpoints):
Dynamic Token Switching
Available Services
| Method | Service | Description |
|---|---|---|
boards() |
BoardsService |
Boards + sections CRUD, list pins |
pins() |
PinsService |
Pins CRUD, save pins |
user() |
UserService |
Account info, analytics |
media() |
MediaService |
Media upload registration |
adAccounts() |
AdAccountsService |
Ad accounts list/get/analytics |
campaigns() |
CampaignsService |
Campaigns CRUD, analytics |
adGroups() |
AdGroupsService |
Ad groups CRUD, analytics |
ads() |
AdsService |
Ads CRUD, analytics |
audiences() |
AudiencesService |
Audiences CRUD |
conversions() |
ConversionsService |
Conversion events + tags |
customerLists() |
CustomerListsService |
Customer lists CRUD |
keywords() |
KeywordsService |
Keywords CRUD, metrics |
oauth() |
OAuthService |
Authorization + token management |
Testing
Static Analysis
Code Formatting
Architecture
The package follows a layered architecture:
- Facade (
Pinterest\Facades\Pinterest) - Static access point - Manager (
Pinterest\Pinterest) - Lazy-loads service instances - Services (
Pinterest\Services\*) - Domain-specific API wrappers - Client (
Pinterest\Client\PinterestClient) - HTTP abstraction with auth, retries, error mapping - Auth (
Pinterest\Auth\OAuthService) - OAuth2 flow management - Support (
Pinterest\Support\*) - Response wrappers, pagination - Exceptions (
Pinterest\Exceptions\*) - Typed exception hierarchy
License
The MIT License (MIT). See LICENSE.md for more information.
All versions of laravel-sdk with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^11.0||^12.0
illuminate/support Version ^11.0||^12.0
illuminate/http Version ^11.0||^12.0