{
  "openapi": "3.1.0",
  "info": {
    "title": "MapExporter Google Maps API",
    "version": "1.0.0",
    "description": "Search Google Maps places, read reviews and public photos as JSON. Each successful call uses one request from the account's monthly API & MCP quota; failed calls are not counted. The same tools are available over Streamable HTTP MCP at https://api.mapexporter.app/mcp/.",
    "contact": {
      "email": "support@mapexporter.app"
    },
    "termsOfService": "https://mapexporter.app/terms/"
  },
  "externalDocs": {
    "description": "Scraper API guide",
    "url": "https://mapexporter.app/google-maps-scraper-api/"
  },
  "servers": [
    {
      "url": "https://api.mapexporter.app"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "paths": {
    "/api/external/maps/search": {
      "post": {
        "operationId": "search_places",
        "summary": "Search places",
        "description": "Search Google Maps places. Each successful call uses one API request. page is the number of pages to collect (1–10). ll uses @lat,lng,zoom.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MapsSearchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "code 10000 returns data. Other codes are business errors with empty data and a localized msg: 999 VALIDATION_ERROR, 10004 AUTH_USER_DISABLED, 10007 AUTH_ACCOUNT_LOCKED, 31201 MAPS_API_QUOTA_EXHAUSTED, 31203 MAPS_API_MEDIA_UNAVAILABLE, 31102 EXTENSION_USAGE_UNAVAILABLE, 500 INTERNAL_SERVER_ERROR.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["code", "data", "msg"],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "data": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/MapsSearchData"
                        },
                        {
                          "type": "object",
                          "maxProperties": 0
                        }
                      ]
                    },
                    "msg": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "10001 AUTH_INVALID_TOKEN: missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["code", "data", "msg"],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "object",
                      "maxProperties": 0
                    },
                    "msg": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/external/maps/reviews": {
      "post": {
        "operationId": "list_reviews",
        "summary": "List reviews",
        "description": "Read Google Maps reviews by fid and optional cursor. Each successful call uses one API request.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MapsReviewsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "code 10000 returns data. Other codes are business errors with empty data and a localized msg: 999 VALIDATION_ERROR, 10004 AUTH_USER_DISABLED, 10007 AUTH_ACCOUNT_LOCKED, 31201 MAPS_API_QUOTA_EXHAUSTED, 31203 MAPS_API_MEDIA_UNAVAILABLE, 31102 EXTENSION_USAGE_UNAVAILABLE, 500 INTERNAL_SERVER_ERROR.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["code", "data", "msg"],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "data": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/GmapReviewPage"
                        },
                        {
                          "type": "object",
                          "maxProperties": 0
                        }
                      ]
                    },
                    "msg": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "10001 AUTH_INVALID_TOKEN: missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["code", "data", "msg"],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "object",
                      "maxProperties": 0
                    },
                    "msg": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/external/maps/photos": {
      "post": {
        "operationId": "list_photos",
        "summary": "List photos",
        "description": "Read public Google Maps photos by fid. max_results limits this delivery (default 200). Results are partial, not a complete album. Each successful call uses one API request.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MapsPhotosRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "code 10000 returns data. Other codes are business errors with empty data and a localized msg: 999 VALIDATION_ERROR, 10004 AUTH_USER_DISABLED, 10007 AUTH_ACCOUNT_LOCKED, 31201 MAPS_API_QUOTA_EXHAUSTED, 31203 MAPS_API_MEDIA_UNAVAILABLE, 31102 EXTENSION_USAGE_UNAVAILABLE, 500 INTERNAL_SERVER_ERROR.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["code", "data", "msg"],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "data": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/GmapPhotosResult"
                        },
                        {
                          "type": "object",
                          "maxProperties": 0
                        }
                      ]
                    },
                    "msg": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "10001 AUTH_INVALID_TOKEN: missing or invalid API key.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["code", "data", "msg"],
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "object",
                      "maxProperties": 0
                    },
                    "msg": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "GmapNamedValues": {
        "properties": {
          "name": {
            "title": "Name",
            "type": "string"
          },
          "values": {
            "items": {
              "type": "string"
            },
            "title": "Values",
            "type": "array"
          }
        },
        "required": ["name", "values"],
        "title": "GmapNamedValues",
        "type": "object"
      },
      "GmapPhoto": {
        "properties": {
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": ["url"],
        "title": "GmapPhoto",
        "type": "object"
      },
      "GmapPhotosResult": {
        "properties": {
          "photos": {
            "items": {
              "$ref": "#/components/schemas/GmapPhoto"
            },
            "title": "Photos",
            "type": "array"
          },
          "returned_count": {
            "title": "Returned Count",
            "type": "integer"
          },
          "reported_total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reported Total"
          },
          "status": {
            "const": "partial",
            "title": "Status",
            "type": "string"
          },
          "reason": {
            "enum": [
              "limit_reached",
              "pagination_unverified",
              "completeness_unverified",
              "pagination_stalled",
              "budget_exhausted",
              "upstream_failed",
              "parse_failed",
              "route_unverified",
              "request_template_invalid"
            ],
            "title": "Reason",
            "type": "string"
          }
        },
        "required": ["photos", "returned_count", "reported_total", "status", "reason"],
        "title": "GmapPhotosResult",
        "type": "object"
      },
      "GmapPlaceEntry": {
        "properties": {
          "name": {
            "title": "Name",
            "type": "string"
          },
          "fid": {
            "title": "Fid",
            "type": "string"
          },
          "search_keyword": {
            "title": "Search Keyword",
            "type": "string"
          },
          "full_address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Full Address"
          },
          "street": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Street"
          },
          "municipality": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Municipality"
          },
          "categories": {
            "items": {
              "type": "string"
            },
            "title": "Categories",
            "type": "array"
          },
          "about": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "About"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Phone"
          },
          "phones": {
            "items": {
              "type": "string"
            },
            "title": "Phones",
            "type": "array"
          },
          "claimed": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Claimed"
          },
          "owner": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Owner"
          },
          "owner_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Owner Id"
          },
          "owner_link": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Owner Link"
          },
          "review_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Review Count"
          },
          "average_rating": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Average Rating"
          },
          "review_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Review Url"
          },
          "cid": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Cid"
          },
          "latitude": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Latitude"
          },
          "longitude": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Longitude"
          },
          "featured_image": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Featured Image"
          },
          "time_zone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Time Zone"
          },
          "website": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Website"
          },
          "domain": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Domain"
          },
          "opening_hours": {
            "items": {
              "$ref": "#/components/schemas/GmapNamedValues"
            },
            "title": "Opening Hours",
            "type": "array"
          },
          "google_knowledge_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Google Knowledge Url"
          },
          "kgmid": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Kgmid"
          },
          "google_maps_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Google Maps Url"
          },
          "place_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Place Id"
          },
          "emails": {
            "items": {
              "type": "string"
            },
            "title": "Emails",
            "type": "array"
          },
          "medias": {
            "additionalProperties": {
              "type": "string"
            },
            "title": "Medias",
            "type": "object"
          }
        },
        "required": [
          "name",
          "fid",
          "search_keyword",
          "full_address",
          "street",
          "municipality",
          "categories",
          "about",
          "phone",
          "phones",
          "claimed",
          "owner",
          "owner_id",
          "owner_link",
          "review_count",
          "average_rating",
          "review_url",
          "cid",
          "latitude",
          "longitude",
          "featured_image",
          "time_zone",
          "website",
          "domain",
          "opening_hours",
          "google_knowledge_url",
          "kgmid",
          "google_maps_url",
          "place_id",
          "emails",
          "medias"
        ],
        "title": "GmapPlaceEntry",
        "type": "object"
      },
      "GmapReview": {
        "properties": {
          "review_id": {
            "title": "Review Id",
            "type": "string"
          },
          "author_name": {
            "title": "Author Name",
            "type": "string"
          },
          "origin": {
            "title": "Origin",
            "type": "string"
          },
          "published_at_ms": {
            "title": "Published At Ms",
            "type": "integer"
          },
          "rating": {
            "title": "Rating",
            "type": "integer"
          },
          "relative_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Relative Date"
          },
          "author_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Author Url"
          },
          "text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Text"
          },
          "translated_text": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Translated Text"
          },
          "language": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Language"
          },
          "owner_response": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Owner Response"
          },
          "author_review_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Author Review Count"
          },
          "owner_response_at_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Owner Response At Ms"
          },
          "author_is_local_guide": {
            "default": false,
            "title": "Author Is Local Guide",
            "type": "boolean"
          },
          "images": {
            "items": {
              "type": "string"
            },
            "title": "Images",
            "type": "array"
          }
        },
        "required": [
          "review_id",
          "author_name",
          "origin",
          "published_at_ms",
          "rating",
          "relative_date",
          "author_url",
          "text",
          "translated_text",
          "language",
          "owner_response",
          "author_review_count",
          "owner_response_at_ms",
          "author_is_local_guide",
          "images"
        ],
        "title": "GmapReview",
        "type": "object"
      },
      "GmapReviewPage": {
        "properties": {
          "reviews": {
            "items": {
              "$ref": "#/components/schemas/GmapReview"
            },
            "title": "Reviews",
            "type": "array"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          }
        },
        "required": ["reviews", "next_cursor"],
        "title": "GmapReviewPage",
        "type": "object"
      },
      "MapsPhotosRequest": {
        "properties": {
          "fid": {
            "pattern": "^0x[0-9a-fA-F]{12,20}:0x[0-9a-fA-F]{12,20}$",
            "title": "Fid",
            "type": "string"
          },
          "max_results": {
            "default": 200,
            "minimum": 1,
            "title": "Max Results",
            "type": "integer"
          }
        },
        "required": ["fid"],
        "title": "MapsPhotosRequest",
        "type": "object"
      },
      "MapsReviewsRequest": {
        "properties": {
          "fid": {
            "pattern": "^0x[0-9a-fA-F]{12,20}:0x[0-9a-fA-F]{12,20}$",
            "title": "Fid",
            "type": "string"
          },
          "cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null,
            "title": "Cursor"
          },
          "sort_by": {
            "default": 1,
            "enum": [1, 2, 3, 4],
            "title": "Sort By",
            "type": "integer"
          },
          "hl": {
            "default": "en",
            "maxLength": 16,
            "minLength": 1,
            "title": "Hl",
            "type": "string"
          }
        },
        "required": ["fid"],
        "title": "MapsReviewsRequest",
        "type": "object"
      },
      "MapsSearchData": {
        "properties": {
          "places": {
            "items": {
              "$ref": "#/components/schemas/GmapPlaceEntry"
            },
            "title": "Places",
            "type": "array"
          },
          "partial": {
            "title": "Partial",
            "type": "boolean"
          },
          "warnings": {
            "items": {
              "type": "string"
            },
            "title": "Warnings",
            "type": "array"
          }
        },
        "required": ["places", "partial", "warnings"],
        "title": "MapsSearchData",
        "type": "object"
      },
      "MapsSearchRequest": {
        "properties": {
          "q": {
            "maxLength": 300,
            "minLength": 1,
            "title": "Q",
            "type": "string"
          },
          "page": {
            "default": 1,
            "maximum": 10,
            "minimum": 1,
            "title": "Page",
            "type": "integer"
          },
          "hl": {
            "default": "en",
            "maxLength": 16,
            "minLength": 1,
            "title": "Hl",
            "type": "string"
          },
          "ll": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "default": null
          },
          "extra": {
            "default": false,
            "title": "Extra",
            "type": "boolean"
          }
        },
        "required": ["q"],
        "title": "MapsSearchRequest",
        "type": "object"
      }
    },
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "User API key (maps_…), generated in the Dashboard at https://mapexporter.app/dashboard/api/."
      }
    }
  }
}
