{
  "openapi": "3.0.1",
  "info": {
    "title": "USPTO Trademark Search — Lookup, Availability & Data",
    "description": "Search and extract USPTO trademark data — keyword search, brand-name availability checks, owner and full-text search, serial-number lookups, class suggestions, and expiring-mark discovery. Seven operations, one clean dataset per run. No API key, no setup.",
    "version": "1.0",
    "x-build-id": "BNvw2qJk03W2eduSf"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sian.agency~uspto-trademark-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sian.agency-uspto-trademark-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/sian.agency~uspto-trademark-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sian.agency-uspto-trademark-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/sian.agency~uspto-trademark-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sian.agency-uspto-trademark-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": [
          "operation"
        ],
        "properties": {
          "operation": {
            "title": "🎯 Operation — what do you want to do?",
            "enum": [
              "search",
              "availability",
              "details",
              "suggestClass",
              "ownerSearch",
              "fullText",
              "expiring"
            ],
            "type": "string",
            "description": "🎯 **PICK ONE OPERATION PER RUN.** Each run produces one clean dataset matching the chosen mode.\n\n- **🔎 Trademark Search** — find marks by keyword; up to 250 records per term (status, owners, classes, dates, logo)\n- **✅ Availability Check** — instant available / not-available verdict per brand name, with the free & taken class list\n- **📑 Trademark Detail** — full record for a known serial number (owners, classification, status history)\n- **🏷️ Class Suggestion** — recommended Nice classes for a product/service description\n- **🏢 Owner Search** — every mark filed by an owner / applicant name (paginated)\n- **🔠 Full-Text Search** — search inside goods-and-services descriptions (paginated)\n- **⏳ Expiring Marks** — marks expiring in a date window — lead-gen for renewals (paginated)\n\n💡 **TIP:** To combine operations, run the actor multiple times with different configurations.",
            "default": "search"
          },
          "queries": {
            "title": "🔢 Queries — terms, owners, serial numbers, or descriptions",
            "type": "array",
            "description": "🔢 **The list of values to look up — meaning depends on the operation:**\n\n- **Search / Availability / Full-Text** → brand keywords (e.g. `apple`, `zillowmatic`)\n- **Details** → serial numbers (e.g. `99408353`)\n- **Owner Search** → owner / applicant names (e.g. `Apple Inc.`)\n- **Class Suggestion** → product/service descriptions (e.g. `software development`)\n\nAdd as many as you like — each value is processed and saved to the dataset.\n\n⚠️ **Ignored** for the **Expiring Marks** operation (which uses the date window below).",
            "items": {
              "type": "string"
            }
          },
          "searchType": {
            "title": "🔘 Search type (Trademark Search only)",
            "enum": [
              "active",
              "all"
            ],
            "type": "string",
            "description": "🔘 **Applies to Trademark Search.** `active` returns live marks only; `all` includes dead/abandoned marks too.",
            "default": "active"
          },
          "maxResultsPerQuery": {
            "title": "🔝 Max results per query (Trademark Search only)",
            "minimum": 1,
            "maximum": 250,
            "type": "integer",
            "description": "🔝 **Applies to Trademark Search.** Cap the number of records returned per keyword (the data source returns up to 250). Lower it to preview results before scaling up.",
            "default": 250
          },
          "startDate": {
            "title": "🗓️ Start date (Expiring Marks only)",
            "type": "string",
            "description": "🗓️ **Required for Expiring Marks.** Window start, `YYYY-MM-DD`. The window must span **7 days or fewer**."
          },
          "endDate": {
            "title": "🗓️ End date (Expiring Marks only)",
            "type": "string",
            "description": "🗓️ **Required for Expiring Marks.** Window end, `YYYY-MM-DD`. Must be within 7 days of the start date."
          },
          "maxPages": {
            "title": "📄 Max pages to fetch (paginated operations)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "📄 **Applies to paginated operations** (Owner Search, Full-Text Search, Expiring Marks) — ~250 records per page. Single-record operations ignore this.\n\n💡 Start small (1–3 pages) to preview. ⚠️ Hard cap: 50 pages.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}