Piloterr
Referencia de la APIRuns

Compare a run with another

GET
/v1/runs/{id}/diff

Rows added, removed and changed since the previous completed run (or against), with the fields that changed, a page at a time. 409 no_previous_run when there is nothing to compare with, run_read_no_rows for a run that failed or was cancelled before reading any row, run_not_finished while a run goes; 410 once either run's results were deleted (30 days after it finished).

Autorización

ApiKeyAuth
headerX-Api-Key<token>

Parámetros de ruta

id*string

The run's id (GET /v1/projects/{id}/runs, or the answer of POST /v1/projects/{id}/runs)

Length1 <= length

Parámetros de consulta

against?string

Another finished (completed, failed or cancelled) run of the project; a retry stands for the run it retries. Default: the latest completed run created before this one, retries aside.

Length1 <= length
change?string

Only the rows of this kind. Default: added, removed and changed (summary always counts all five).

Value in"added""removed""changed""unchanged""failed"
fields?string

Comma-separated fields to compare, in place of the project's tracked fields (tracked_fields).

offset?|

Items to skip, among those matching change

Range0 <= value
Default0
limit?integer

Items to return

Range1 <= value <= 500
Default100

Cuerpo de la respuesta

The diff

application/json
  1. response

Rows are matched by their call parameters; each run counts with its retries (the latest attempt of each row). failed: in both runs, but one of the two has no result to compare.

run_id*string

The run (the first launched, for a retry)

against_run_id*string
tracked_fields*array<string>

Fields compared; empty: all but volatile ones

summary*
total*integer

Rows matching change

items*array<>
Example Request
curl -X GET 'https://dataflow.piloterr.com/v1/runs/string/diff'
Example Response
{
  "run_id": "cm4j1m8ws0009l208b6yk3pne",
  "against_run_id": "cm4i0a7qd0005l208r2wn8sgd",
  "tracked_fields": [
    "price",
    "stock",
    "coupon"
  ],
  "summary": {
    "added": 0,
    "removed": 0,
    "changed": 1,
    "unchanged": 1,
    "failed": 0
  },
  "total": 1,
  "items": [
    {
      "change": "changed",
      "key": {
        "query": "B09DFCB66S",
        "domain": "com"
      },
      "row": 0,
      "previous_row": 0,
      "fields": [
        {
          "field": "stock",
          "before": "In Stock",
          "after": "Only 5 left in stock - order soon."
        }
      ]
    }
  ]
}