Beta sign in

Pipe library / fx-threshold

fx-threshold

ECB foreign-exchange rate from Frankfurter, emitted when it is at or above a threshold.

Price and market

api.frankfurter.appapi.frankfurter.dev

CLI

pipes run examples/fx-threshold.pipe.yaml

MCP call

{
  "name": "pipe__fx-threshold",
  "arguments": {}
}

Pipe file

examples/fx-threshold.pipe.yaml

pipes: 0
name: fx-threshold
version: 0.1.0
description: ECB foreign-exchange rate from Frankfurter, emitted when it is at or above a threshold.
permissions:
  network: [api.frankfurter.app, api.frankfurter.dev]
inputs:
  type: object
  properties:
    base:
      type: string
      pattern: "^[A-Z]{3}$"
      default: USD
    quote:
      type: string
      pattern: "^[A-Z]{3}$"
      default: EUR
    at_least:
      type: number
      minimum: 0
      default: 0
  required: [base, quote]
outputs:
  type: object
  properties:
    text: { type: string }
    count: { type: integer }
  required: [text, count]
output:
  text: "${steps.format.text}"
  count: "${steps.format.count}"
steps:
  - id: fetch
    block: fetch_http
    with:
      url: https://api.frankfurter.app/latest
      query:
        from: "${inputs.base}"
        to: "${inputs.quote}"
      max_bytes: 100000
    retry: { max: 2, backoff_ms: 500 }
    timeout_ms: 15000
  - id: rates
    block: parse_json
    in: "${steps.fetch}"
    with:
      path: rates
      entries: true
  - id: shaped
    block: map
    in: "${steps.rates}"
    with:
      set:
        pair: "${inputs.base}/${item.key}"
        rate: "${item.value}"
      number: [rate]
      pick: [pair, rate]
  - id: hot
    block: filter
    in: "${steps.shaped}"
    with:
      where: { field: rate, op: gte, value: "${inputs.at_least}" }
  - id: format
    block: format
    in: "${steps.hot}"
    with:
      header: "FX:\n"
      item_template: "- ${item.pair} ${item.rate}"
      separator: "\n"
  - id: print
    block: emit_stdout
    in: "${steps.format.text}"
    with: { format: text }