{
  "openapi": "3.0.1",
  "info": {
    "title": "HTML to Markdown Converter – Clean HTML & Datasets for LLMs",
    "description": "Convert HTML you already have to clean Markdown: pasted HTML, JSON documents, the html field of any scraper dataset, or HTML file URLs. Removes nav, footers and cookie banners, keeps tables and code, makes links absolute. Optional RAG chunks. No page fetching. $0.30 per 1,000 documents.",
    "version": "0.1",
    "x-build-id": "PyfrKgcSCnzBBvlDK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gazidev~html-to-markdown-converter/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gazidev-html-to-markdown-converter",
        "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/gazidev~html-to-markdown-converter/runs": {
      "post": {
        "operationId": "runs-sync-gazidev-html-to-markdown-converter",
        "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/gazidev~html-to-markdown-converter/run-sync": {
      "post": {
        "operationId": "run-sync-gazidev-html-to-markdown-converter",
        "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": {
          "html": {
            "title": "HTML",
            "type": "string",
            "description": "Paste one HTML document or fragment. Leave empty if you use the other sources. With no input at all, a built-in sample document is converted."
          },
          "htmlDocuments": {
            "title": "Several HTML documents (JSON)",
            "type": "array",
            "description": "A JSON array of HTML strings, or of objects like {\"id\": \"a1\", \"html\": \"<p>...</p>\", \"url\": \"https://site.com/page\"}. The url (or baseUrl) of each object is used to make its relative links absolute. Handy for API calls and AI agents."
          },
          "datasetId": {
            "title": "Apify dataset with HTML",
            "type": "string",
            "description": "Convert an HTML field of every item in a dataset, e.g. the output of a scraper that saved page HTML. In an integration / webhook use {{resource.defaultDatasetId}}."
          },
          "htmlField": {
            "title": "Dataset: HTML field",
            "type": "string",
            "description": "Name of the field that holds the HTML in the dataset items. Dot paths work, e.g. response.body.",
            "default": "html"
          },
          "urlField": {
            "title": "Dataset: URL field",
            "type": "string",
            "description": "Field with the page URL, used as the base for relative links and copied to the output. Leave empty if there is none.",
            "default": "url"
          },
          "keepFields": {
            "title": "Dataset: fields to copy",
            "type": "array",
            "description": "Fields of the source item to copy to each output row (under sourceFields), e.g. title, category, scrapedAt.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "fileUrls": {
            "title": "HTML file URLs",
            "type": "array",
            "description": "Direct links to HTML files you host or exported (S3, GitHub raw, an Apify key-value store record, ...). Each file is downloaded once (max 10 MB). Private and internal network addresses are refused. To crawl live websites, use our Website to Markdown actor instead.",
            "items": {
              "type": "string"
            }
          },
          "baseUrl": {
            "title": "Base URL for relative links",
            "type": "string",
            "description": "Used to make relative links and images absolute when a document has no URL of its own (e.g. https://example.com/blog/). A <base href> in the HTML wins."
          },
          "mainContentOnly": {
            "title": "Main content only (remove boilerplate)",
            "type": "boolean",
            "description": "Keep only the main content: drops navigation, headers, footers, sidebars, cookie banners, share bars and similar. Turn off to convert the whole body.",
            "default": true
          },
          "includeLinks": {
            "title": "Keep links",
            "type": "boolean",
            "description": "Write links as [text](url). Off = plain link text only (fewer tokens).",
            "default": true
          },
          "includeImages": {
            "title": "Keep images",
            "type": "boolean",
            "description": "Write images as ![alt](url).",
            "default": false
          },
          "removeSelectors": {
            "title": "Extra CSS selectors to remove",
            "type": "string",
            "description": "Comma-separated CSS selectors removed before conversion, e.g. .ad-box, #comments, .author-bio."
          },
          "chunkSize": {
            "title": "RAG chunk size (tokens)",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "If above 0, each row also gets chunks[] split on headings and paragraphs, about this many tokens each (estimate: 4 characters = 1 token), with the heading path. Code blocks are not split. 0 = off.",
            "default": 0
          },
          "maxItems": {
            "title": "Max documents",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many documents (all sources together). Empty = no limit. Your maximum charge per run is also respected."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}