Piloterr
API-ReferenzInputs

Test a search input

POST
/v1/inputs/search/preview

Runs the first search once, its first page only, with the managed Dataflow key, and returns its results so columns can be mapped: one row per result, each with search_query. Nothing is stored: use {"type": "search", …} as a project's input, and every run searches again, reading up to pages pages of every search. The call is billed like any call of the search endpoint. At most 10 previews a minute per workspace, URL and search previews together. Then map the project endpoint's parameters to these columns, e.g. a product endpoint's query to {"column": "asin"}.

Autorisierung

ApiKeyAuth
headerX-Api-Key<token>

Anfragetext

application/json
  1. body
endpoint_id*string

A search endpoint: its path ends in /search and it takes a query

Length1 <= length
queries*array<>

Up to 100 searches, each run on its own: keywords, or search URLs when the endpoint takes them in its query (e.g. https://allegro.pl/listing?string=iphone). Repeats are dropped. Each row's search_query column says which search found it.

Items1 <= items <= 100
params?

The search's other parameters, the same at every run (e.g. Amazon's domain). Not query nor page.

pages?integer

Pages of results read for each search at every run, when the endpoint has pages (default 5); the reading stops at the last page. Each page is one billed call of the search endpoint, and a run makes at most 1000 (searches × pages).

Range1 <= value <= 50

Antworttext

The first page of results (id is empty: nothing is stored)

application/json
  1. response
id*string
filename*string|null
columns*array<string>
row_count*integer
sample*array<>
sheets*array<string>
stats*
Example Request
curl -X POST 'https://dataflow.piloterr.com/v1/inputs/search/preview' \
  -H 'Content-Type: application/json' \
  -d '{
  "endpoint_id": "cm0p7x8vf000b08l4c9u1h6rt",
  "queries": [
    "playstation 5"
  ],
  "params": {
    "domain": "com"
  },
  "pages": 2
}'
Example Response
{
  "id": "",
  "filename": "playstation 5",
  "columns": [
    "search_query",
    "url",
    "asin",
    "price",
    "title",
    "rating",
    "reviews_count"
  ],
  "row_count": 1,
  "sample": [
    {
      "search_query": "playstation 5",
      "url": "https://www.amazon.com/dp/B0FRGMYJMG",
      "asin": "B0FRGMYJMG",
      "price": "",
      "title": "PlayStation®5 Digital Edition – 825GB",
      "rating": "4.8",
      "reviews_count": "196"
    }
  ],
  "sheets": [],
  "stats": {
    "empty_rows": 0,
    "duplicate_rows": 0,
    "deduplicated": false,
    "row_error_count": 0,
    "row_errors": []
  }
}