{
  "openapi": "3.0.1",
  "info": {
    "title": "Citation & Quote Verifier for AI Output",
    "description": "Checks whether a cited page is reachable and whether the quoted passage is actually on it.",
    "version": "0.1",
    "x-build-id": "kxBtkdkx6hUSMiZea"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/plusonets~citation-claim-verifier/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-plusonets-citation-claim-verifier",
        "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/plusonets~citation-claim-verifier/runs": {
      "post": {
        "operationId": "runs-sync-plusonets-citation-claim-verifier",
        "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/plusonets~citation-claim-verifier/run-sync": {
      "post": {
        "operationId": "run-sync-plusonets-citation-claim-verifier",
        "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",
        "properties": {
          "items": {
            "title": "Citations",
            "type": "array",
            "description": "Each item is a claim, an optional source URL, and an optional quote to find on that page. Leave this empty and omit inline text to run the eight-citation demo.",
            "items": {
              "type": "object",
              "properties": {
                "claim": {
                  "type": "string",
                  "title": "Claim",
                  "description": "What the citation is supposed to support."
                },
                "url": {
                  "type": "string",
                  "title": "Source URL",
                  "description": "http or https page to fetch. Private and local addresses are refused.",
                  "nullable": true
                },
                "quote": {
                  "type": "string",
                  "title": "Quote",
                  "description": "Passage that should appear on the page. Omit it for a reachability check only.",
                  "nullable": true
                }
              }
            },
            "default": [
              {
                "claim": "The Constitution's preamble says the people ordained it to form a more perfect Union.",
                "url": "http://www.archives.gov/founding-docs/constitution-transcript",
                "quote": "We the People of the United States, in Order to form a more perfect Union"
              },
              {
                "claim": "The preamble still begins with the words We the People.",
                "url": "https://www.archives.gov/founding-docs/constitution-transcript",
                "quote": "we  the  people of the united states, in order to form a more perfect union"
              },
              {
                "claim": "The Constitution's preamble names a colony on Mars.",
                "url": "https://www.archives.gov/founding-docs/constitution-transcript",
                "quote": "We the Robots of Mars, in Order to form a more perfect Colony"
              },
              {
                "claim": "The National Archives publishes a transcription of the Declaration of Independence.",
                "url": "https://www.archives.gov/founding-docs/declaration-transcript",
                "quote": null
              },
              {
                "claim": "Python is a high-level, general-purpose programming language.",
                "url": "https://en.wikipedia.org/wiki/Python_(programming_language)",
                "quote": "Python is a high-level, general-purpose programming language"
              },
              {
                "claim": "Python was invented by Linus Torvalds as a spreadsheet macro language.",
                "url": "https://en.wikipedia.org/wiki/Python_(programming_language)",
                "quote": "Python was invented by Linus Torvalds as a spreadsheet macro language"
              },
              {
                "claim": "A National Archives page documents this citation-verifier demo.",
                "url": "https://www.archives.gov/founding-docs/citation-claim-verifier-missing-page",
                "quote": "This page documents the citation verifier."
              },
              {
                "claim": "The W3C dummy PDF says Dummy PDF file.",
                "url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
                "quote": "Dummy PDF file"
              }
            ]
          },
          "inlineText": {
            "title": "Inline JSON, CSV, or Markdown",
            "type": "string",
            "description": "Optional extra citations. JSON object or array, a CSV with claim/url/quote columns, or Markdown links. A blockquote next to a link is used as the quote.",
            "default": ""
          },
          "maxItems": {
            "title": "Maximum citations",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Stop after this many citations. The cap is 200.",
            "default": 50
          },
          "maxChargeUsd": {
            "title": "Maximum charge (USD)",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "Stop billing once the estimated total reaches this amount. Uses the suggested event prices as a local estimate. The platform max total charge still applies.",
            "default": 5
          },
          "llmProvider": {
            "title": "LLM provider",
            "enum": [
              "none",
              "openai",
              "anthropic"
            ],
            "type": "string",
            "description": "Optional supports / neutral / contradicts verdict. Quote matching still runs when this is none.",
            "default": "none"
          },
          "llmApiKey": {
            "title": "LLM API key",
            "type": "string",
            "description": "Your OpenAI or Anthropic key. Stored encrypted. Never sent anywhere except that provider."
          },
          "llmModel": {
            "title": "LLM model",
            "type": "string",
            "description": "Optional model id. Empty uses gpt-4o-mini or claude-3-5-haiku-latest.",
            "default": ""
          },
          "checkWayback": {
            "title": "Look up Wayback Machine",
            "type": "boolean",
            "description": "Ask archive.org for the closest snapshot URL. Unofficial. A lookup failure does not fail the citation check.",
            "default": true
          },
          "browserFallback": {
            "title": "Browser fallback",
            "type": "boolean",
            "description": "Off by default. When on, a JavaScript-empty page is retried with a browser-like User-Agent, then with Playwright only if that package is installed. The published image does not include a browser.",
            "default": false
          },
          "alertOnlyOnChange": {
            "title": "Alert only on change",
            "type": "boolean",
            "description": "Push and bill a citation only when its status, match kind, or page text hash changed since the last successful run.",
            "default": false
          },
          "dedupe": {
            "title": "Drop duplicate citations",
            "type": "boolean",
            "description": "Skip later rows with the same claim, URL, and quote, ignoring case on the claim and quote.",
            "default": true
          },
          "requestTimeoutSecs": {
            "title": "Request timeout",
            "minimum": 5,
            "maximum": 60,
            "type": "integer",
            "description": "Seconds to wait for each HTTP response.",
            "default": 20
          },
          "maxConcurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "How many citations to fetch at once.",
            "default": 4
          },
          "maxRedirects": {
            "title": "Maximum redirects",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "How many redirects to follow. Each hop is checked for private addresses.",
            "default": 5
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}