{
  "openapi": "3.0.1",
  "info": {
    "title": "2GIS Search Scraper",
    "description": "Scrape public 2GIS search pages for business names, addresses, categories, ratings, working hours, and geographic coordinates.",
    "version": "2.2",
    "x-build-id": "GLHSl72GyOGSFGZ3g"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/searchapi~2gis-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-searchapi-2gis-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/searchapi~2gis-scraper/runs": {
      "post": {
        "operationId": "runs-sync-searchapi-2gis-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/searchapi~2gis-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-searchapi-2gis-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",
        "properties": {
          "query": {
            "title": "Search query",
            "type": "string",
            "description": "A business name, category, or service to enter in 2GIS."
          },
          "queries": {
            "title": "Additional searches",
            "maxItems": 50,
            "type": "array",
            "description": "Optional list of business names, categories, or services. Each value is paginated independently and contributes records to the same deduplicated dataset.",
            "items": {
              "type": "string"
            }
          },
          "city": {
            "title": "City or region",
            "maxLength": 120,
            "type": "string",
            "description": "Optional city or region appended to each search, for example Dubai or Saint Petersburg."
          },
          "startUrls": {
            "title": "Advanced 2GIS search URLs",
            "maxItems": 50,
            "type": "array",
            "description": "Optional public 2GIS search URLs for advanced workflows. Page URLs continue from their supplied /page/N path and are combined with query searches.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "title": "URL",
                  "description": "A public HTTPS search URL on a supported 2GIS domain such as 2gis.com or 2gis.ae.",
                  "type": "string"
                }
              },
              "additionalProperties": false
            }
          },
          "maxItems": {
            "title": "Maximum listings",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of unique businesses to save across all queries and start URLs after filters are applied.",
            "default": 100
          },
          "maxPages": {
            "title": "Maximum pages per source",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum number of result pages to request independently for each query or start URL.",
            "default": 3
          },
          "sortBy": {
            "title": "Sort results",
            "enum": [
              "relevance",
              "ratingDesc",
              "ratingAsc",
              "reviewCountDesc",
              "reviewCountAsc",
              "photoCountDesc",
              "averageBillAsc",
              "averageBillDesc",
              "nameAsc",
              "nameDesc"
            ],
            "type": "string",
            "description": "Relevance preserves 2GIS discovery order. Other choices sort the combined normalized records after enrichment.",
            "default": "relevance"
          },
          "includeKeywords": {
            "title": "Include keywords",
            "maxItems": 50,
            "type": "array",
            "description": "Keep businesses containing at least one keyword in the public name, address, categories, description, or published attributes.",
            "items": {
              "type": "string"
            }
          },
          "excludeKeywords": {
            "title": "Exclude keywords",
            "maxItems": 50,
            "type": "array",
            "description": "Remove businesses containing any keyword in the public name, address, categories, description, or published attributes.",
            "items": {
              "type": "string"
            }
          },
          "includeCategories": {
            "title": "Include categories",
            "maxItems": 50,
            "type": "array",
            "description": "Keep businesses whose published 2GIS categories contain at least one of these values.",
            "items": {
              "type": "string"
            }
          },
          "excludeCategories": {
            "title": "Exclude categories",
            "maxItems": 50,
            "type": "array",
            "description": "Remove businesses whose published 2GIS categories contain any of these values.",
            "items": {
              "type": "string"
            }
          },
          "minRating": {
            "title": "Minimum rating",
            "minimum": 0,
            "maximum": 5,
            "type": "number",
            "description": "Keep businesses with a published 2GIS rating at or above this value. Missing ratings do not match."
          },
          "maxRating": {
            "title": "Maximum rating",
            "minimum": 0,
            "maximum": 5,
            "type": "number",
            "description": "Keep businesses with a published 2GIS rating at or below this value. Missing ratings do not match."
          },
          "minReviewCount": {
            "title": "Minimum review count",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Keep businesses with at least this many published reviews."
          },
          "minPhotoCount": {
            "title": "Minimum photo count",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Keep businesses with at least this many published gallery photos."
          },
          "minAverageBill": {
            "title": "Minimum average bill",
            "minimum": 0,
            "maximum": 10000000,
            "type": "number",
            "description": "Keep businesses whose public Info tab exposes an average bill at or above this value."
          },
          "maxAverageBill": {
            "title": "Maximum average bill",
            "minimum": 0,
            "maximum": 10000000,
            "type": "number",
            "description": "Keep businesses whose public Info tab exposes an average bill at or below this value."
          },
          "onlyOpenNow": {
            "title": "Open now only",
            "type": "boolean",
            "description": "Keep businesses whose public Contacts page reports an open or working status at scrape time.",
            "default": false
          },
          "requireWebsite": {
            "title": "Require website",
            "type": "boolean",
            "description": "Keep only businesses with a public external website URL exposed by 2GIS.",
            "default": false
          },
          "requirePhone": {
            "title": "Require phone",
            "type": "boolean",
            "description": "Keep only businesses with at least one public phone number exposed by 2GIS.",
            "default": false
          },
          "requirePhotos": {
            "title": "Require photos",
            "type": "boolean",
            "description": "Keep only businesses with a published gallery photo count or stable public photo URL.",
            "default": false
          },
          "requireMenu": {
            "title": "Require menu photos",
            "type": "boolean",
            "description": "Keep only businesses whose public Menu view exposes menu photos. Missing client-rendered menu data does not match.",
            "default": false
          },
          "requireCoordinates": {
            "title": "Require coordinates",
            "type": "boolean",
            "description": "Keep only businesses with valid public latitude and longitude values.",
            "default": false
          },
          "includeDetails": {
            "title": "Fetch business details",
            "type": "boolean",
            "description": "Fetch public Contacts, Info, Reviews, Photos, and Menu views for rich fields. Automatically enabled when a selected filter or sort needs those fields.",
            "default": true
          },
          "includeInfo": {
            "title": "Fetch Info attributes",
            "type": "boolean",
            "description": "Fetch cuisine, features, services, payment methods, accessibility, parking, landmarks, categories, and related searches.",
            "default": true
          },
          "includeReviews": {
            "title": "Fetch review snippets",
            "type": "boolean",
            "description": "Fetch bounded public review snippets with visible reviewer display names and aggregate review counts when available; profile identifiers and URLs are omitted.",
            "default": true
          },
          "includePhotos": {
            "title": "Fetch photo metadata",
            "type": "boolean",
            "description": "Fetch public gallery metadata and stable 2GIS photo URLs when available.",
            "default": true
          },
          "includeMenu": {
            "title": "Check menu photos",
            "type": "boolean",
            "description": "Check whether the public Menu view exposes menu photos. Structured menu items are not fabricated when 2GIS only exposes images.",
            "default": true
          },
          "maxReviews": {
            "title": "Maximum review snippets",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum public review snippets to include per business. Only publicly displayed reviewer names and review counts are retained; profile identifiers and URLs are omitted.",
            "default": 5
          },
          "maxPhotos": {
            "title": "Maximum photo URLs",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Maximum stable public 2GIS photo URLs to include per business.",
            "default": 20
          },
          "maxConcurrency": {
            "title": "Maximum concurrency",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Maximum number of independent query sources and business-detail enrichments processed at the same time. Lower this if 2GIS rate-limits the run.",
            "default": 2
          },
          "maxRequestRetries": {
            "title": "Maximum request retries",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Bounded retries for temporary network, proxy, rate-limit, redirect, and server failures.",
            "default": 3
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Maximum wait time for each public search or detail page response.",
            "default": 45
          },
          "requestDelayMs": {
            "title": "Delay between requests (ms)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Polite delay before each public page request. A delay is applied independently for retries and concurrent workers.",
            "default": 500
          },
          "requestDelayMillis": {
            "title": "Request delay compatibility alias",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Compatibility alias for requestDelayMs. Use requestDelayMs for new runs."
          },
          "datasetBatchSize": {
            "title": "Dataset batch size",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Number of normalized records sent to the Apify dataset per push operation.",
            "default": 25
          },
          "useApifyProxy": {
            "title": "Use Apify Proxy",
            "type": "boolean",
            "description": "Compatibility input accepted for existing integrations that route requests through Apify Proxy.",
            "default": false
          },
          "proxyGroups": {
            "title": "Apify Proxy groups",
            "maxItems": 10,
            "type": "array",
            "description": "Optional Apify Proxy group names.",
            "items": {
              "type": "string"
            }
          },
          "proxyCountryCode": {
            "title": "Proxy country code",
            "pattern": "^[A-Za-z]{2}$",
            "type": "string",
            "description": "Optional two-letter Apify Proxy country code."
          },
          "proxyUrls": {
            "title": "Custom proxy URLs",
            "maxItems": 20,
            "type": "array",
            "description": "Optional authorized custom proxy URLs; credentials are never logged.",
            "items": {
              "type": "string"
            }
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional authorized Apify or custom proxy configuration. Credentials are never logged. GOOGLE_SERP is not used because this Actor targets 2GIS.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}