# Zazzle Search ## Overview | Property | Value | |----------|-------| | **Status** | active | | **Method** | `GET` | | **Endpoint** | `/v2/zazzle/search` | | **Base URL** | `https://api.piloterr.com` | | **Credit Cost** | 1 credit per call | | **Documentation** | https://www.piloterr.com/library/zazzle-search | ## Description Search Zazzle products by keyword. page maps to the pg parameter. Prices are a number plus a display string. ## Authentication - **Key Name:** `x-api-key` - **Location:** HTTP Header - **Get an API key:** https://app.piloterr.com/register ## Example Request ```bash curl --location --request GET 'https://api.piloterr.com/v2/zazzle/search' \ --header 'Content-Type: application/json' \ --header 'x-api-key: YOUR_API_KEY' ``` ## Example Response ### coffee mug ```json { "results": [ { "url": "https://www.zazzle.com/branded_logo_two_tone_coffee_mug-256528848440338952", "image": "https://rlv.zcache.com/branded_logo_two_tone_coffee_mug-r_k6fu4x_306.jpg", "price": 15.81, "title": "Branded Logo Two-Tone Coffee Mug", "product_id": "256528848440338952", "price_display": "$15.81", "original_price": 18.6, "original_price_display": "$18.60" } ], "pagination": { "next": "https://www.zazzle.com/s/coffee+mug?pg=2", "page": 1, "per_page": 60, "total_pages": 44398, "total_results": 2663878 } } ``` ## Documentation ## Overview Search Zazzle products. `query` is a keyword or a `zazzle.com/s/...` URL. `page` maps to the site parameter `pg`. A product URL, whose slug ends in a long number, returns 400. Use the product endpoint for that URL. Each card has `price` as a number and `price_display` as the same amount in text, for example `15.81` and `$15.81`. `original_price` and `original_price_display` are set only when the page shows a strikethrough price. ## Quickstart ``` curl -sS -H "x-api-key: YOUR_API_KEY" "https://api.piloterr.com/v2/zazzle/search?query=coffee%20mug" curl -sS -H "x-api-key: YOUR_API_KEY" "https://api.piloterr.com/v2/zazzle/search?query=coffee%20mug&page=2" ``` ## Parameters | Name | Detail | |---|---| | query | Required string. Keyword or a zazzle.com/s URL. Example: `coffee mug`. A product URL returns 400. | | page | Optional integer from 1. Example: `2`. Maps to `pg`. Defaults to 1. | ## Response fields | Name | Detail | |---|---| | results[].product_id | String. Numeric id at the end of the product slug. | | results[].title | String. | | results[].url | String. Product URL. Pass it to the product endpoint. | | results[].image | String or null. | | results[].price | Number or null. Current price. | | results[].price_display | String or null. Same price as shown, for example `$15.81`. | | results[].original_price | Number or null. Strikethrough price when the card has one. | | results[].original_price_display | String or null. | | pagination.page | Integer. | | pagination.per_page | Integer. Number of cards parsed on this page. | | pagination.total_results | Integer or null. The result count on the page. A broad keyword can be in the millions. | | pagination.total_pages | Integer or null. | | pagination.next | String or null. Next search URL with `pg`, for example `https://www.zazzle.com/s/coffee+mug?pg=2`. Null on the last page. | ## Pagination `page=2` requests `https://www.zazzle.com/s/coffee+mug?pg=2`. `pagination.next` uses that same `pg` parameter. Product ids on a page are unique and page 2 does not repeat page 1. `next` is null only when there is no further page. ## Use cases - A merch seller tracks `coffee mug` prices and checks that `price` matches `price_display`. - A catalog walks `page=2`, which Zazzle calls `pg=2`, until `next` is null. - A store monitor collects each `url` and opens it with the product endpoint for the brand and description. ## Error codes | Name | Detail | |---|---| | 400 | Missing `query`, a host other than zazzle.com, or a product URL sent to search. | | 404 | No products, or `page` past the last page. | | 401 | Missing API key. | | 500 | The Zazzle request failed. | ## Related endpoints - [Zazzle Product](https://www.piloterr.com/library/zazzle-product)