{
  "openapi": "3.0.1",
  "info": {
    "title": "Texas Bar & Restaurant Sales Rankings (Mixed Beverage Data)",
    "description": "Rank every Texas bar, restaurant, hotel & venue by alcohol sales from official Comptroller mixed beverage receipts. Trailing-12-month totals, YoY growth, latest month, new venues & possibly closed venues. Filter by county, city, ZIP. Or export raw monthly records.",
    "version": "0.1",
    "x-build-id": "RG9vZdfpvCRF9tEpG"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lonestar-leads~texas-bar-restaurant-sales/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lonestar-leads-texas-bar-restaurant-sales",
        "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/lonestar-leads~texas-bar-restaurant-sales/runs": {
      "post": {
        "operationId": "runs-sync-lonestar-leads-texas-bar-restaurant-sales",
        "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/lonestar-leads~texas-bar-restaurant-sales/run-sync": {
      "post": {
        "operationId": "run-sync-lonestar-leads-texas-bar-restaurant-sales",
        "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": {
          "mode": {
            "title": "Output mode",
            "enum": [
              "venues",
              "monthly"
            ],
            "type": "string",
            "description": "venues = one row per venue with trailing-12-month totals, YoY change, latest month, ranks, new/closed flags. monthly = raw monthly sales records (one row per venue per month).",
            "default": "venues"
          },
          "counties": {
            "title": "Counties",
            "type": "array",
            "description": "Texas county names, e.g. Harris, Travis, Lubbock. Empty = all 254 counties.",
            "items": {
              "type": "string"
            }
          },
          "cities": {
            "title": "Cities",
            "type": "array",
            "description": "City names (case-insensitive exact match), e.g. Austin, Lubbock. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "zipCodes": {
            "title": "ZIP codes",
            "type": "array",
            "description": "5-digit ZIP codes. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "nameContains": {
            "title": "Venue or owner name contains",
            "type": "string",
            "description": "Case-insensitive substring, e.g. \"Twin Peaks\" or \"Hilton\"."
          },
          "minTrailing12Total": {
            "title": "Minimum trailing-12-month sales ($) (venues mode)",
            "minimum": 0,
            "type": "integer",
            "description": "Only venues whose total alcohol receipts over the last 12 months are at least this amount.",
            "default": 0
          },
          "onlyNewVenues": {
            "title": "Only new venues (venues mode)",
            "type": "boolean",
            "description": "Only venues whose first-ever report falls in the last 12 months (new openings or new ownership).",
            "default": false
          },
          "onlyPossiblyClosed": {
            "title": "Only possibly closed venues (venues mode)",
            "type": "boolean",
            "description": "Only venues that reported within the last 12 months but not for the latest month.",
            "default": false
          },
          "sortBy": {
            "title": "Sort by (venues mode)",
            "enum": [
              "trailing12Total",
              "latestMonthTotal",
              "yoyChangePct",
              "name"
            ],
            "type": "string",
            "description": "How to order venue results.",
            "default": "trailing12Total"
          },
          "asOfMonth": {
            "title": "As-of month (optional)",
            "pattern": "^$|^\\d{4}-(0[1-9]|1[0-2])$",
            "type": "string",
            "description": "YYYY-MM. Defaults to the latest complete month in the data (the newest month is usually still partial)."
          },
          "monthsBack": {
            "title": "Months back (monthly mode)",
            "minimum": 1,
            "maximum": 240,
            "type": "integer",
            "description": "Number of months to export, ending at the as-of month.",
            "default": 3
          },
          "startMonth": {
            "title": "Start month (monthly mode, optional)",
            "pattern": "^$|^\\d{4}-(0[1-9]|1[0-2])$",
            "type": "string",
            "description": "YYYY-MM. Overrides Months back."
          },
          "endMonth": {
            "title": "End month (monthly mode, optional)",
            "pattern": "^$|^\\d{4}-(0[1-9]|1[0-2])$",
            "type": "string",
            "description": "YYYY-MM. Defaults to the as-of month."
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 1000000,
            "type": "integer",
            "description": "Maximum rows to output.",
            "default": 1000
          },
          "socrataAppToken": {
            "title": "Socrata app token (optional)",
            "type": "string",
            "description": "Optional free data.texas.gov app token for higher rate limits."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}