{
  "openapi": "3.0.1",
  "info": {
    "title": "Prometheus Endpoint Extractor",
    "description": "Point at any Prometheus HTTP API v1 server (Prometheus, Thanos, Mimir, VictoriaMetrics, Grafana Agent) and export PromQL query results, range series, label values, scrape targets, rules, metric metadata and build info as clean rows. One actor over every Prometheus-compatible server.",
    "version": "0.1",
    "x-build-id": "uYKsMoHrObdc0YyHf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datamule~prometheus-endpoint-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datamule-prometheus-endpoint-extractor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/datamule~prometheus-endpoint-extractor/runs": {
      "post": {
        "operationId": "runs-sync-datamule-prometheus-endpoint-extractor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/datamule~prometheus-endpoint-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-datamule-prometheus-endpoint-extractor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "sources"
        ],
        "properties": {
          "sources": {
            "title": "Prometheus base URLs",
            "type": "array",
            "description": "One or more Prometheus-compatible server base URLs. Any server that speaks the Prometheus HTTP API v1 works — Prometheus, Thanos, Cortex/Mimir, VictoriaMetrics, Grafana Agent, etc. Give the bare base (https://demo.promlabs.com) and the actor appends the right /api/v1 path per mode, or paste a full /api/v1/query URL. A reverse-proxy sub-path is honored (VictoriaMetrics' https://host/select/0/prometheus).",
            "items": {
              "type": "string"
            }
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "query",
              "query_range",
              "series",
              "labels",
              "label_values",
              "targets",
              "rules",
              "metadata",
              "buildinfo"
            ],
            "type": "string",
            "description": "What to extract. query (default): run a PromQL expression at /api/v1/query (one row per series). query_range: sample an expression over a time window at /api/v1/query_range. series: matching series (label sets) from /api/v1/series. labels: all label names. label_values: values of one label (default __name__ = every metric name). targets: scrape targets. rules: recording/alerting rules. metadata: per-metric type/unit/help. buildinfo: server version.",
            "default": "query"
          },
          "query": {
            "title": "PromQL query",
            "type": "string",
            "description": "The PromQL expression to evaluate (query and query_range modes). Examples: up (which targets are up), rate(http_requests_total[5m]), sum by (job) (up), scalar(count(up)). Default: up.",
            "default": "up"
          },
          "time": {
            "title": "Evaluation time (query mode)",
            "type": "string",
            "description": "Optional evaluation timestamp for query mode — an RFC3339 string (2026-07-08T00:00:00Z) or a unix timestamp. Leave empty to evaluate at the current server time."
          },
          "start": {
            "title": "Range start (query_range mode)",
            "type": "string",
            "description": "Start of the range window for query_range mode — RFC3339 or unix timestamp. Leave empty to default to 5 minutes ago."
          },
          "end": {
            "title": "Range end (query_range mode)",
            "type": "string",
            "description": "End of the range window for query_range mode — RFC3339 or unix timestamp. Leave empty to default to now."
          },
          "step": {
            "title": "Range step seconds (query_range mode)",
            "type": "string",
            "description": "Resolution step for query_range mode — seconds (60) or a Prometheus duration (1m, 15s). Leave empty to default to 60."
          },
          "match": {
            "title": "Series selectors (series / labels / label_values)",
            "type": "array",
            "description": "One or more Prometheus series selectors used by series (required), labels, and label_values modes to restrict the result. Examples: up  or  {job=\"demo\"}  or  node_cpu_seconds_total{mode=\"idle\"}. Leave empty in labels/label_values to enumerate across all series.",
            "items": {
              "type": "string"
            }
          },
          "labelName": {
            "title": "Label name (label_values mode)",
            "type": "string",
            "description": "The label whose values to enumerate in label_values mode. Default __name__ returns every metric name in the server. Other examples: job, instance, namespace.",
            "default": "__name__"
          },
          "maxRecords": {
            "title": "Max records (global cap)",
            "minimum": 1,
            "type": "integer",
            "description": "A GLOBAL cap on the number of rows to emit across all sources (each row is one billable event). Leave empty to emit everything. label_values on __name__ or metadata can be thousands of rows, so a cap is useful there."
          },
          "bearer": {
            "title": "Bearer token",
            "type": "string",
            "description": "Optional bearer token for a Prometheus server behind auth (sent as Authorization: Bearer ***). Not required for open servers. Never logged."
          },
          "extraHeaders": {
            "title": "Extra request headers",
            "type": "object",
            "description": "Optional extra HTTP headers as a JSON object, e.g. {\"x-scope-orgid\": \"tenant-a\"} (Cortex/Mimir multi-tenant) or a cookie for a gated server. Header values are never logged."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}