{
  "openapi": "3.0.1",
  "info": {
    "title": "Patch Scraper",
    "description": "Scrape Patch.com hyperlocal US news, local events, and classifieds. Search by keyword; browse by town, category, author, or tag; or browse the events calendar or marketplace listings. Filter by date range or distance. Get headline, summary, author, date, town, category, and image.",
    "version": "1.0",
    "x-build-id": "ZVQEDN3h3jg5mZLop"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~patch-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-patch-scraper",
        "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/crawlerbros~patch-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-patch-scraper",
        "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/crawlerbros~patch-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-patch-scraper",
        "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": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "search",
              "byTown",
              "byCategory",
              "byAuthor",
              "byTag",
              "events",
              "classifieds"
            ],
            "type": "string",
            "description": "What to fetch from Patch.com.",
            "default": "search"
          },
          "searchQuery": {
            "title": "Search query",
            "type": "string",
            "description": "Free-text keyword to search for (mode=search; also applies as a keyword filter on mode=events/classifieds). Leave empty on other modes to browse without a keyword filter, or leave empty on mode=search to browse the newest articles matching the other filters below."
          },
          "authorName": {
            "title": "Author name",
            "type": "string",
            "description": "Exact byline/reporter/poster name (required for mode=byAuthor; on any other mode -- including events/classifieds -- it's applied as an extra filter, e.g. combine mode=search + searchQuery + authorName to search one reporter's own articles). Find it in the `author` field of any article/event/classified this actor returns, e.g. \"Eric Heyl\"."
          },
          "tagName": {
            "title": "Tag name",
            "type": "string",
            "description": "Exact editorial tag (required for mode=byTag; on mode=search/byTown/byCategory/byAuthor it's applied as an extra filter, e.g. combine mode=byCategory + category + tagName to browse one category narrowed to a tag). Find it in the `tags` field of any article this actor returns, e.g. \"Back To School\". Only a minority of articles carry tags, so run another mode first to discover one. Not applicable to mode=events/classifieds -- Patch doesn't tag those content types."
          },
          "regionSlug": {
            "title": "State",
            "enum": [
              "",
              "alabama",
              "alaska",
              "arizona",
              "arkansas",
              "california",
              "colorado",
              "connecticut",
              "delaware",
              "district-columbia",
              "florida",
              "georgia",
              "hawaii",
              "idaho",
              "illinois",
              "indiana",
              "iowa",
              "kansas",
              "kentucky",
              "louisiana",
              "maine",
              "maryland",
              "massachusetts",
              "michigan",
              "minnesota",
              "mississippi",
              "missouri",
              "montana",
              "nebraska",
              "nevada",
              "new-hampshire",
              "new-jersey",
              "new-mexico",
              "new-york",
              "north-carolina",
              "north-dakota",
              "ohio",
              "oklahoma",
              "oregon",
              "pennsylvania",
              "rhode-island",
              "south-carolina",
              "south-dakota",
              "tennessee",
              "texas",
              "us-territories",
              "utah",
              "vermont",
              "virginia",
              "washington",
              "west-virginia",
              "wisconsin",
              "wyoming"
            ],
            "type": "string",
            "description": "US state to scope results to (required for mode=byTown; optional scope filter on every other mode, including events/classifieds). Leave as \"(any state)\" for nationwide results.",
            "default": ""
          },
          "townSlug": {
            "title": "Town/city slug",
            "type": "string",
            "description": "Patch town/city URL slug (required for mode=byTown; requires regionSlug too). Find it in a Patch URL, e.g. patch.com/california/santamonica -> \"santamonica\". Example: \"santamonica\" (with regionSlug=california).",
            "default": ""
          },
          "category": {
            "title": "Category",
            "enum": [
              "",
              "around-town",
              "arts-entertainment",
              "bulletinboard",
              "business",
              "going-green",
              "holidays",
              "kids-family",
              "lifestyle",
              "obituaries",
              "personal-finance",
              "pets",
              "police-fire",
              "politics",
              "real-estate",
              "restaurants-bars",
              "schools",
              "small-business-voices",
              "sports",
              "traffic-transit",
              "travel",
              "weather"
            ],
            "type": "string",
            "description": "News category/topic to filter by (required for mode=byCategory; optional filter on mode=search/byTown/byAuthor/byTag). Not applicable to mode=events/classifieds -- use `classifiedCategory` for mode=classifieds instead.",
            "default": ""
          },
          "classifiedCategory": {
            "title": "Classified category",
            "enum": [
              "",
              "announcements",
              "for-sale",
              "free-stuff",
              "gigs-services",
              "housing",
              "lost-found",
              "news-tip",
              "opinion",
              "other",
              "question",
              "recommendation"
            ],
            "type": "string",
            "description": "Classifieds category to filter by (mode=classifieds only; a completely separate value set from `category`, which is news-only). Leave as \"(any category)\" to browse every classified category.",
            "default": ""
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "relevance",
              "newest",
              "oldest",
              "nearest",
              "eventDate"
            ],
            "type": "string",
            "description": "Order of results. \"Nearest first\" requires both `nearLat`/`nearLng` AND mode=search/byTown/byCategory/byAuthor/byTag (news); otherwise it falls back to Relevance. \"Soonest event first\" requires mode=events; on any other mode it also falls back to Relevance.",
            "default": "relevance"
          },
          "publishedAfter": {
            "title": "Published after (YYYY-MM-DD)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Only include articles/events/classifieds posted to Patch on or after this date (i.e. listing date, not an event's own occurrence date -- see `eventDateAfter` for that). Format: YYYY-MM-DD. Combine with `publishedBefore` for a date range."
          },
          "publishedBefore": {
            "title": "Published before (YYYY-MM-DD)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Only include articles/events/classifieds posted to Patch on or before this date. Format: YYYY-MM-DD. Combine with `publishedAfter` for a date range."
          },
          "eventDateAfter": {
            "title": "Event date after (YYYY-MM-DD)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "mode=events only. Only include events occurring on or after this date (the event's own date, not when it was posted to Patch -- see `publishedAfter` for that). Format: YYYY-MM-DD. Combine with `eventDateBefore` for a date range, e.g. \"what's happening this weekend\"."
          },
          "eventDateBefore": {
            "title": "Event date before (YYYY-MM-DD)",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "mode=events only. Only include events occurring on or before this date. Format: YYYY-MM-DD. Combine with `eventDateAfter` for a date range."
          },
          "nearLat": {
            "title": "Near latitude",
            "minimum": -90,
            "maximum": 90,
            "type": "number",
            "description": "Latitude of a point to search near (combine with `nearLng` and `radiusMiles`). News modes only (search/byTown/byCategory/byAuthor/byTag) -- not available for mode=events/classifieds, whose Patch indexes don't expose a filterable location field. Both `nearLat` and `nearLng` must be set together; otherwise this filter is ignored."
          },
          "nearLng": {
            "title": "Near longitude",
            "minimum": -180,
            "maximum": 180,
            "type": "number",
            "description": "Longitude of a point to search near (combine with `nearLat` and `radiusMiles`). News modes only -- see `nearLat` description. Both `nearLat` and `nearLng` must be set together; otherwise this filter is ignored."
          },
          "radiusMiles": {
            "title": "Radius (miles)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Search radius around `nearLat`/`nearLng`, in miles. News modes only -- see `nearLat` description. Ignored unless both `nearLat` and `nearLng` are set.",
            "default": 25
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 250,
            "type": "integer",
            "description": "Maximum number of articles/events/classifieds to return.",
            "default": 25
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}