# PetSmart Search ## Overview | Property | Value | |----------|-------| | **Status** | active | | **Method** | `GET` | | **Endpoint** | `/v2/petsmart/search` | | **Base URL** | `https://api.piloterr.com` | | **Credit Cost** | 1 credit per call | | **Documentation** | https://www.piloterr.com/library/petsmart-search | ## Description Search PetSmart by keyword or search URL. Page through pet food, litter, and supplies with dollar prices. ## 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/petsmart/search' \ --header 'Content-Type: application/json' \ --header 'x-api-key: YOUR_API_KEY' ``` ## Example Response ### Purina Pro Plan card on dog food ```json { "results": [ { "id": "5252900", "url": "https://www.petsmart.com/dog/food/dry-food/purina-pro-plan-sensitive-skin-and-stomach-dry-dog-food-adult-salmon-and-rice-formula-digestive-health-36648.html", "brand": "Purina Pro Plan", "image": "https://s7d2.scene7.com/is/image/PetSmart/5252900?$sclp-prd-main_large$&fmt=webp&qlt=80", "price": 20.68, "title": "Purina Pro Plan Sensitive Skin and Stomach Dry Dog Food Adult Salmon & Rice Formula Digestive Health", "rating": 4.5, "currency": "USD", "in_stock": true, "price_max": null, "price_label": "Options from", "rating_count": 9221, "price_display": "$20.68", "variant_count": 4, "original_price": 21.99, "master_product_id": "36648", "price_max_display": null, "original_price_display": "$21.99" } ], "pagination": { "next": "https://www.petsmart.com/search/?q=dog+food&page=2", "page": 1, "per_page": 40, "total_pages": 83, "total_results": 3317 } } ``` ## Documentation ## Overview Search PetSmart for pet food, treats, and supplies. The listing page is read with the website crawler. `query` is a keyword, or a PetSmart search link. `page` starts at 1. Page 2 uses `page=2`. A product link returns 400. Another website returns 400. ## Quickstart ``` GET https://api.piloterr.com/v2/petsmart/search?query=dog+food ``` ``` GET https://api.piloterr.com/v2/petsmart/search?query=cat+litter&page=2 ``` ``` GET https://api.piloterr.com/v2/petsmart/search?query=https://www.petsmart.com/search/?q=dog+food ``` ## Parameters | Parameter | Type | Required | Description | |---|---|---|---| | `query` | string | yes | Keyword or PetSmart search URL. Placeholder: `dog food`. A product URL returns 400. | | `page` | integer | no | Page number from 1. Placeholder: `1`. | | `return_page_source` | boolean | no | When true, the response is the raw HTML in `result`. | ## Response fields Each item in `results` is one product card. `price` is the selling price shown on the card. `price_display` is that number in dollars. `original_price` is the crossed-out price when it is higher. `price_label` is text such as `Options from` when PetSmart prints it. `pagination.next` is the next page URL, or null on the last page. ## Use cases - Compare dog-food prices on PetSmart - Page through a large litter search - Turn a keyword into a product id and URL ## Error codes | Code | Meaning | |---|---| | 400 | Empty query, another website, a product link, or a page below 1 | | 404 | The page had no product cards | | 500 | The fetch failed |