# Castorama Search ## Overview | Property | Value | |----------|-------| | **Status** | active | | **Method** | `GET` | | **Endpoint** | `/v2/castorama/search` | | **Base URL** | `https://api.piloterr.com` | | **Credit Cost** | 1 credit per call | | **Documentation** | https://www.piloterr.com/library/castorama-search | ## Description Search Castorama by keyword or search URL and page the DIY listings. Cards include title, price, and product link. ## 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/castorama/search' \ --header 'Content-Type: application/json' \ --header 'x-api-key: YOUR_API_KEY' ``` ## Example Response ### joint-silicone, first product ```json { "results": [ { "ean": "5410091628840", "url": "https://www.castorama.fr/mastic-bain-et-cuisine-rubson-blanc-280ml/5410091628840_CAFR.prd", "name": "Mastic bain et cuisine Rubson blanc 280ml", "image": "https://media.castorama.fr/is/image/Castorama/mastic-bain-et-cuisine-rubson-blanc-280ml~5410091628840_30c_FR_CF", "price": 10.9, "rating": 4.5, "currency": "EUR", "position": 1, "was_price": null, "unit_price": 38.93, "review_count": 55, "price_display": "10,90 €", "was_price_display": null, "unit_price_display": "38,93 € / L" } ], "pagination": { "next": "https://www.castorama.fr/search?term=joint-silicone&page=2", "page": 1, "per_page": 48, "total_pages": 189, "total_results": 9050 } } ``` ## Documentation ## Overview **Castorama** product search on www.castorama.fr. `query` is a keyword or a listing URL (`/search?term=` or a category path ending in `.cat`). The response is `{ results, pagination }`. Each card has the EAN, name, product URL, image, price, rating and, when the card shows it, the unit price. A product URL (`…_CAFR.prd`) returns `400`. ## Quickstart ``` GET https://api.piloterr.com/v2/castorama/search?query=joint-silicone GET https://api.piloterr.com/v2/castorama/search?query=joint-silicone&page=2 GET https://api.piloterr.com/v2/castorama/search?query=https://www.castorama.fr/search?term=joint-silicone GET https://api.piloterr.com/v2/castorama/search?query=https://www.castorama.fr/outillage/outillage-electroportatif/perceuse-visseuse-perceuse-a-percussion-et-tournevis-sans-fil/cat_id_3796.cat ``` ## `query` **Example (keyword):** joint-silicone **Example (search URL):** https://www.castorama.fr/search?term=joint-silicone **Example (category URL):** https://www.castorama.fr/outillage/outillage-electroportatif/perceuse-visseuse-perceuse-a-percussion-et-tournevis-sans-fil/cat_id_3796.cat `query` is required. Only `www.castorama.fr` is accepted. | Form | Example | What happens | |---|---|---| | Keyword | `joint-silicone` | Builds `https://www.castorama.fr/search?term=joint-silicone`. Some keywords redirect to a category; the cards of that page are returned. | | Search URL | `https://www.castorama.fr/search?term=joint-silicone` | Uses that listing. `page` adds or replaces `?page=`. | | Category URL | `https://www.castorama.fr/outillage/outillage-electroportatif/perceuse-visseuse-perceuse-a-percussion-et-tournevis-sans-fil/cat_id_3796.cat` | Category listing. The path must end with `.cat`. | A product URL returns `400`. Another host returns `400`. An empty value returns `400`. `page` below 1 returns `400`. `page` starts at 1. Page 2 of the same listing is `?page=2`. ## Parameters | Parameter | Type | Required | Description | |---|---|---|---| | `query` | string | yes | Keyword, `/search` URL, or `.cat` category URL | | `page` | integer | no | Page from 1. Sent as `?page=` on the listing. | ## Response fields | Field | Type | Description | |---|---|---| | `results[]` | array | Product cards on this page | | `results[].position` | integer | Position on the page, from 1 | | `results[].ean` | string \| null | EAN from the card | | `results[].name` | string | Product name | | `results[].url` | string | Product URL ending in `_CAFR.prd` | | `results[].image` | string \| null | Main image | | `results[].price` | number \| null | Price in euros | | `results[].price_display` | string \| null | Price as shown, for example `10,90 €` | | `results[].was_price` | number \| null | Crossed-out price when the card shows one | | `results[].was_price_display` | string \| null | Crossed-out price as shown, for example `41,90 €` | | `results[].currency` | string \| null | `EUR` when a price is present | | `results[].rating` | number \| null | Average rating out of 5 | | `results[].review_count` | integer \| null | Number of reviews | | `results[].unit_price` | number \| null | Unit price when the card shows one | | `results[].unit_price_display` | string \| null | Unit price as shown, for example `38,93 € / L` | | `pagination.page` | integer | Requested page | | `pagination.per_page` | integer | Cards returned on this page | | `pagination.total_results` | integer \| null | Total from the heading | | `pagination.total_pages` | integer \| null | Last page link | | `pagination.next` | string \| null | Next page URL, or null on the last page | ## Notes `was_price` is the crossed-out price on the card. It is `null` when the page shows only the current price. `price` stays the current price. Cards outside the product list are ignored, and a repeated product URL is returned once. A broad keyword can redirect to a guide without products (`scie`, `joint`) and then returns `404`. Pass the category `.cat` URL instead. `price` is a number (`10.9`) and `price_display` keeps the French comma (`10,90 €`). Currency is `EUR`. `unit_price` is set only when the card shows a line such as `soit 38,93 € / L`. `per_page` is the number of cards on this page (48 on the keyword page checked here, 54 on the drill category). `total_results` is the figure in the heading (`9 050 produits`). `total_pages` is the last page link. The sample below keeps the first card. A live call returns every card on the page. A page with no product card returns `404`. ## Main use cases - Monitor paint, tools, and building prices in France - Page a category - Resolve a keyword to a product URL ## Error codes | Code | Meaning | |---|---| | `400` | Empty query, unknown host, product URL, or `page` below 1 | | `403` | Blocked | | `404` | No product card on the page | | `500` | Fetch failed | ## Related endpoints [Castorama Product](https://www.piloterr.com/library/castorama-product)