# RS Online Search ## Overview | Property | Value | |----------|-------| | **Status** | active | | **Method** | `GET` | | **Endpoint** | `/v2/rsonline/search` | | **Base URL** | `https://api.piloterr.com` | | **Credit Cost** | 2 credits per call | | **Documentation** | https://www.piloterr.com/library/rsonline-search | ## Description Search RS Online UK by keyword or category. Pound prices keep the amount printed on the page. ## 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/rsonline/search' \ --header 'Content-Type: application/json' \ --header 'x-api-key: YOUR_API_KEY' ``` ## Example Response ### WAGO 221 splice connector on RS Online UK ```json { "results": [ { "mpn": "221-2401", "url": "https://uk.rs-online.com/web/p/splice-connectors/0303327", "brand": "WAGO", "price": 4.95, "title": "WAGO, 221 Wire Splice Splice Connector, Clear, Insulated 12 AWG", "category": "Splice Connectors", "currency": "GBP", "in_stock": true, "image_url": "https://media.rs-online.com/t_large/Y0303327-01.jpg", "pack_size": 10, "product_id": "0303327", "stock_status": "IN_STOCK", "price_display": "£4.95", "rs_stock_number": "030-3327", "minimum_order_qty": 1 } ], "pagination": { "next": "https://uk.rs-online.com/web/c/?searchTerm=connector&pn=2", "page": 1, "per_page": 20, "total_pages": 3220, "total_results": 64395 } } ``` ## Documentation ## Overview Search RS Online UK. A browser loads uk.rs-online.com and the response is the product cards on that page. ## Quickstart Keyword, page 1 ``` GET https://api.piloterr.com/v2/rsonline/search?query=connector ``` Page 2 ``` GET https://api.piloterr.com/v2/rsonline/search?query=connector&page=2 ``` ## Parameters | Parameter | Type | Required | Default | What to pass | What changes in the JSON | |---|---|---|---|---|---| | `query` | string | yes | empty, which returns 400 | A keyword such as `connector`, or a uk.rs-online.com search or category link | A keyword builds `/web/c/?searchTerm=...`. Each card has `price` as a number and `price_display` as the pound string. A product link returns 400. | | `page` | integer | no | omit for page 1 | An integer from 1 | Page 2 sets `pn=2`, sets `pagination.page` to 2, and returns the next cards. `pagination.next` is that next URL, or null on the last page. | | `return_page_source` | boolean | no | false | `true` or `false` | `true` replaces `results` and `pagination` with `result`, the rendered HTML. | ## Response fields `price` is the numeric pound amount. `price_display` is the printed string, such as `£4.95`. A trailing dash is removed. `rs_stock_number` is the RS stock code. ## Use cases - Find a connector by keyword - Page through a category - Collect brand, manufacturer part, and the pound price ## Error codes | Code | Meaning | |---|---| | 400 | Empty query, another website, a product link, or a page below 1 | | 404 | The page had no products | | 500 | The fetch failed |