Download the PHP package tomgould/puzzlerphpsdk without Composer
On this page you can find all versions of the php package tomgould/puzzlerphpsdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package puzzlerphpsdk
PuzzlerPHPSDK
A PHP SDK for the Puzzler Media REST API.
Unofficial client. This library is not affiliated with or endorsed by Puzzler Media. You need your own API credentials (client ID, API key and secret key), which are issued by Puzzler.
Installation
Install via Composer:
Requirements
- PHP 7.4 or higher
- cURL extension
- JSON extension
Quick Start
Usage
Initialize Client
Health Check
Get Puzzle Dictionary
The dictionary endpoint returns all available puzzle types and names from the latest bundle.
Example response:
Collect Puzzles
Get all puzzles from the latest bundle
Filter by specific date
Note: Date must be in YYYY-MM-DD format. The API returns puzzles from the latest bundle, so requesting dates outside the bundle's range will return empty results.
Filter by date range
Filter by puzzle types
Available puzzle type abbreviations:
XW- CrosswordXC- Cryptic CrosswordWW- Word WheelWS- WordsearchSW- SplitwordsSU- Sudoku (all variants)JS- JigsawHM- HangmanAU- Add Up
Filter by puzzle names
When filtering by puzzle names, you can specify exact puzzle names. If you want only specific puzzle variants (e.g., only "Easy Sudoku"), do NOT include that puzzle type in puzzleTypes, otherwise all puzzles of that type will be returned.
Combine multiple filters
Practical Examples
Get today's wordsearches:
Get all sudoku variants for a date range:
Build a weekly puzzle archive:
Error Handling
The SDK throws specific exceptions for different error types:
API Reference
PuzzlerClient
Main client class for accessing the API.
Constructor
Methods
puzzle(): PuzzleClient- Get puzzle client instancehealth(): HealthClient- Get health client instance
PuzzleClient
Client for puzzle-related operations.
Methods
collect(array $filters = []): array- Collect puzzles with optional filtersdictionary(): array- Get dictionary of available puzzle types and names
Collect Filters
| Parameter | Type | Required | Format | Description |
|---|---|---|---|---|
puzzleDate |
string | No | YYYY-MM-DD | Exact date to filter by |
puzzleDateFrom |
string | No | YYYY-MM-DD | Start date for range filter |
puzzleDateTo |
string | No | YYYY-MM-DD | End date for range filter |
puzzleTypes |
array | No | Array of strings | Puzzle type abbreviations |
puzzleNames |
array | No | Array of strings | Exact puzzle names |
HealthClient
Client for health check operations.
Methods
check(): string- Check API health status
Exception Hierarchy
Troubleshooting
No puzzles returned when filtering by date
Problem: You're filtering by a specific date but getting an empty array back, even though puzzles should exist.
Possible causes:
- Date is outside the bundle range: The API only returns puzzles from the "latest bundle". If you request a date that's not in the current bundle, you'll get no results.
- Date format is incorrect: Ensure you're using YYYY-MM-DD format (e.g., '2025-11-12', not '11/12/2025')
- No puzzles published for that date: Some dates may not have puzzles available
Solution:
Building a puzzle archive
Problem: You need to archive puzzles from multiple days/weeks/months, but the API only provides the "latest bundle".
Solution: You'll need to implement a cron job or scheduled task that regularly fetches and stores puzzles:
Authentication errors
Problem: Getting 401 Authentication Failed errors.
Possible causes:
- Incorrect credentials: Double-check your Client ID, API Key, and Secret Key
- Clock skew: The API signature is time-sensitive (valid for 5 minutes). Ensure your server's clock is synchronized
Solution:
Filter by puzzle name not working
Problem: You're filtering by puzzle name but getting all puzzles of that type.
Cause: When using puzzleNames, you must NOT include the corresponding puzzle type in puzzleTypes, otherwise the API returns all puzzles of that type.
Incorrect:
Correct:
Empty results with valid filters
Problem: You're certain your filters should match puzzles, but you're getting an empty array.
Debug steps:
API Quirks and Technical Notes
Request Body Format
The Puzzler API has an unusual requirement for the request body format:
-
When filters are provided: Send them directly in the request body
- When no filters are provided: The body must be wrapped in a "model" property
This SDK handles this automatically, so you don't need to worry about it.
Date Filtering Behavior
The API operates on the "latest bundle" concept:
- Puzzles are bundled and released periodically
- You can only access puzzles from the current/latest bundle
- Historical puzzles from older bundles are not accessible via the API
- To build an archive, you must fetch and store puzzles regularly
Signature Validity
Authentication signatures are valid for 5 minutes from generation. The SDK generates a fresh signature for each request, so this shouldn't be an issue unless you have extreme clock skew.
Testing
Setup
-
Copy the environment example file:
-
Edit
.envand add your credentials: - Load environment variables:
Run Tests
Run all tests:
Run only unit tests (no credentials required):
Run only integration tests (credentials required):
Test your credentials specifically:
Run with coverage:
Test Structure
License
MIT License - see LICENSE file for details
Author
Tom Gould
- GitHub: @tomgould
Repository
https://github.com/tomgould/PuzzlerPHPSDK
Support
For issues, questions, or contributions, please visit the GitHub repository.
All versions of puzzlerphpsdk with dependencies
ext-curl Version *
ext-json Version *