GET /api/wallpapers
Retrieve wallpapers from WallWidgy’s collection with flexible filtering options. This is the main endpoint for accessing wallpapers with support for category, color, and device type filtering.This endpoint fetches wallpapers from a GitHub repository index file and supports filtering by multiple criteria. It’s ideal for applications that need category-based browsing with color filtering.
Query parameters
Filter by device orientation. Accepts
desktop for landscape wallpapers or mobile for portrait wallpapers. The filter is applied based on the orientation field in the wallpaper index.Filter by category name. Categories are prefixed with
# in the index (e.g., nature, abstract, space). Provide the category name without the # prefix.Filter by primary or secondary color. Use lowercase color names. The endpoint searches both primary and secondary color fields for matches.
Number of random wallpapers to return. Must be between 1 and 10. Results are randomly shuffled before selection. Defaults to 1.
Response
Array of wallpaper URLs. Each URL points to the full-resolution wallpaper image.
Full URL to the wallpaper image
Actual number of wallpapers returned in the response
The category filter that was applied, or
all if no category filter was specifiedThe device type filter that was applied, or
all if no type filter was specifiedThe color filter that was applied, or
all if no color filter was specifiedError responses
Error message describing what went wrong
Additional debug information (only included in development mode)
- No wallpapers match the specified category
- No wallpapers match the specified color
- No wallpapers are available
- Failed to fetch the wallpaper index from GitHub
- An unexpected server error occurs
Examples
Example response
Example response with filters
Example error responses
Category not found
No wallpapers with color
Server error
Filtering behavior
Category filtering
When you specify a category, the endpoint:- Fetches the wallpaper index from GitHub
- Filters items where
categorymatches#<your-category> - Returns 404 if no wallpapers match the category
Color filtering
Color filtering searches bothprimary_colors and secondary_colors fields:
- Splits the color fields by spaces
- Matches exact color names (case-insensitive)
- Returns 404 if no wallpapers match the color
Type filtering
Type filtering is based on theorientation field in the index:
type=desktopfilters fororientation: "Desktop"type=mobilefilters fororientation: "Mobile"- If no wallpapers match after type filtering, the filter is ignored
Multiple filters
You can combine multiple filters. They are applied in this order:- Category filter (if specified)
- Color filter (if specified)
- Type filter (if specified)
- Random shuffle and count selection
CORS support
This endpoint includes CORS headers to allow cross-origin requests:Access-Control-Allow-Origin: *Access-Control-Allow-Methods: GETAccess-Control-Allow-Headers: Content-Type