{
  "openapi": "3.0.1",
  "info": {
    "title": "Patch.com Local News, Events & Classifieds Finder",
    "description": "Search Patch.com's hyperlocal US news by keyword, town, category, author, or tag, and browse its local events calendar or classifieds board, with date-range and distance filters.",
    "version": "1.0",
    "x-build-id": "kgvnqgKSosfpPzZC4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/dataspryva~patch-com-local-news-events-and-classifieds-finder/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-dataspryva-patch-com-local-news-events-and-classifieds-finder",
        "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/dataspryva~patch-com-local-news-events-and-classifieds-finder/runs": {
      "post": {
        "operationId": "runs-sync-dataspryva-patch-com-local-news-events-and-classifieds-finder",
        "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/dataspryva~patch-com-local-news-events-and-classifieds-finder/run-sync": {
      "post": {
        "operationId": "run-sync-dataspryva-patch-com-local-news-events-and-classifieds-finder",
        "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",
              "byUrl"
            ],
            "type": "string",
            "description": "What to fetch from Patch.com.",
            "default": "search"
          },
          "startUrls": {
            "title": "Patch URLs",
            "type": "array",
            "description": "mode=byUrl only. Paste Patch article, event, classified, town, category/topic, state or search URLs. Article/event/classified URLs are scraped directly; town/topic/state/search URLs are converted into the equivalent scoped query.",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL",
                  "description": "A full Patch.com URL (or patch.com/... path)."
                }
              }
            }
          },
          "searchQuery": {
            "title": "Search query",
            "type": "string",
            "description": "Free-text keyword to search for (mode=search; also applies to mode=events/classifieds and to scope URLs). Leave empty to browse the newest articles matching the other filters."
          },
          "searchMatch": {
            "title": "Search match",
            "enum": [
              "allWords",
              "exactPhrase"
            ],
            "type": "string",
            "description": "How multi-word searches match. \"All words\" requires every word anywhere in the headline/summary/topic (more results). \"Exact phrase\" requires the words to appear together (the old behavior).",
            "default": "allWords"
          },
          "authorName": {
            "title": "Author name",
            "type": "string",
            "description": "Exact byline/reporter/poster name (required for mode=byAuthor; on any other mode it is an extra server-side filter). Copy it from this actor's `author` output field, e.g. \"Eric Heyl\".",
            "default": ""
          },
          "tagName": {
            "title": "Tag name",
            "type": "string",
            "description": "Exact editorial tag (required for mode=byTag; on article modes it is an extra filter). Copy it from this actor's `tags` field, e.g. \"Back To School\". Only a minority of articles carry tags.",
            "default": ""
          },
          "regionSlug": {
            "title": "State",
            "enum": [
              "",
              "across-america",
              "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/edition to scope results to (required for mode=byTown; optional filter on every other mode). \"Across America\" is Patch's national edition (code US); \"US Territories\" is a valid Patch region with no current articles.",
            "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
          },
          "includeBodyText": {
            "title": "Include full body text",
            "type": "boolean",
            "description": "Add bodyHtml (the original HTML), bodyText (readable plain text) and bodyLength to each record. Article/event/classified bodies come from Patch's own search payload, so this costs no extra request.",
            "default": true
          },
          "includeDetails": {
            "title": "Enrich from detail pages",
            "type": "boolean",
            "description": "Fetch each record's Patch page and add gallery images/captions/credits, author avatar and points, comment/reply counts, breaking/sponsored flags, town grade/weekly views/ZIPs/timezone/county/metro, event venue/type/website, and classified contact state. One extra request per record; failed pages never discard the base record.",
            "default": false
          },
          "maxDetails": {
            "title": "Max detail pages",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "How many records to enrich when `includeDetails` is on. 0 means every emitted record (up to `maxItems`). Ignored when detail enrichment is off.",
            "default": 100
          },
          "monitorMode": {
            "title": "Monitor: only new records",
            "type": "boolean",
            "description": "Emit only records whose Patch ID has not been seen by an earlier run with the same monitor key. State is stored in the actor's key-value store.",
            "default": false
          },
          "monitorKey": {
            "title": "Monitor key",
            "type": "string",
            "description": "Optional namespace for monitor state. Give different saved tasks different keys to keep their seen-ID lists separate. Derived automatically from the mode and filters when empty.",
            "default": ""
          },
          "maxItems": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of articles, events or classifieds to return (1-1000). Requests above 250 are automatically split into date partitions to bypass Patch's 250-hit search-key window.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}