models.py•7.79 kB
# generated by fastapi-codegen:
# filename: openapi.yaml
# timestamp: 2025-07-08T17:49:41+00:00
from __future__ import annotations
from datetime import datetime
from enum import Enum
from typing import List, Optional
from pydantic import AnyUrl, BaseModel, Field, constr
class Language(Enum):
en = 'en'
af = 'af'
az = 'az'
id = 'id'
ms = 'ms'
bs = 'bs'
ca = 'ca'
cs = 'cs'
da = 'da'
de = 'de'
et = 'et'
es = 'es'
es_419 = 'es-419'
eu = 'eu'
fil = 'fil'
fr = 'fr'
gl = 'gl'
hr = 'hr'
zu = 'zu'
is_ = 'is'
it = 'it'
sw = 'sw'
lv = 'lv'
lt = 'lt'
hu = 'hu'
nl = 'nl'
no = 'no'
uz = 'uz'
pl = 'pl'
pt_BR = 'pt-BR'
pt_PT = 'pt-PT'
ro = 'ro'
sq = 'sq'
sk = 'sk'
sl = 'sl'
fi = 'fi'
sv = 'sv'
vi = 'vi'
tr = 'tr'
el = 'el'
bg = 'bg'
ky = 'ky'
kk = 'kk'
mk = 'mk'
mn = 'mn'
ru = 'ru'
sr = 'sr'
uk = 'uk'
ka = 'ka'
hy = 'hy'
iw = 'iw'
ur = 'ur'
ar = 'ar'
fa = 'fa'
am = 'am'
ne = 'ne'
hi = 'hi'
mr = 'mr'
bn = 'bn'
pa = 'pa'
gu = 'gu'
ta = 'ta'
te = 'te'
kn = 'kn'
ml = 'ml'
si = 'si'
th = 'th'
lo = 'lo'
my = 'my'
km = 'km'
ko = 'ko'
ja = 'ja'
zh_CN = 'zh-CN'
zh_TW = 'zh-TW'
class ReviewsOrigin(Enum):
all = 'all'
google = 'google'
class ReviewsSort(Enum):
newest = 'newest'
mostRelevant = 'mostRelevant'
highestRanking = 'highestRanking'
lowestRanking = 'lowestRanking'
class StartUrl(BaseModel):
url: AnyUrl = Field(..., title='URL of a web page')
class InputSchema(BaseModel):
language: Optional[Language] = Field(
'en',
description='Results details will show in this language.',
title='Language',
)
maxReviews: Optional[int] = Field(
10000000,
description='Max number of reviews per place to scrape. If you fill in 0 or nothing, no reviews will be scraped. For all reviews, just put 99999.',
title='Number of reviews',
)
personalData: Optional[bool] = Field(
True,
description="This settings allows you to obtain personal data about reviewer (his ID, name, URL and his photo URL) and about review (ID and URL). Personal data is protected by the GDPR in the European Union and by other regulations around the world. You should not scrape personal data unless you have a legitimate reason to do so. If you're unsure whether your reason is legitimate, consult your lawyers.",
title='Personal data',
)
placeIds: Optional[List[str]] = Field(
None,
description='List of place IDs. You can add place IDs one by one or upload a list using the <strong>Bulk edit</strong> option.',
title='🗃 Place IDs',
)
reviewsOrigin: Optional[ReviewsOrigin] = Field(
'all',
description='Select whether you want all reviews (from Google, Tripadvisor, etc.) or only reviews from Google',
title='Reviews origin',
)
reviewsSort: Optional[ReviewsSort] = Field(
'newest',
description='Define how reviews should be sorted.',
title='Sort reviews by',
)
reviewsStartDate: Optional[
constr(
pattern=r'^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])(T[0-2]\d:[0-5]\d(:[0-5]\d)?(\.\d+)?Z?)?$|^(\d+)\s*(minute|hour|day|week|month|year)s?$'
)
] = Field(
None,
description='Either absolute date (e.g. `2024-05-03`) or relative date from now into the past (e.g. `8 days`, `3 months`). JSON input also supports adding time in both absolute (ISO standard, e.g. `2024-05-03T20:00:00`) and relative (e.g. `3 hours`) formats. Absolute time is always interpreted in the UTC timezone, not your local timezone - please convert accordingly. Supported relative date & time units: `minutes`, `hours`, `days`, `weeks`, `months`, `years`.',
title='Only scrape reviews newer than [date]',
)
startUrls: Optional[List[StartUrl]] = Field(
None,
description='List of URLs to be crawled. They can be search URLs, place URLs or review detail URLs. Valid Google Maps place URLs must contain one of the following subpaths: <code>/maps/search</code>, <code>/maps/place</code> or <code>/maps/reviews</code>.',
title='Google Maps place URLs',
)
class Meta(BaseModel):
origin: Optional[str] = Field(None, examples=['API'])
userAgent: Optional[str] = None
class Options(BaseModel):
build: Optional[str] = Field(None, examples=['latest'])
diskMbytes: Optional[int] = Field(None, examples=[2048])
memoryMbytes: Optional[int] = Field(None, examples=[1024])
timeoutSecs: Optional[int] = Field(None, examples=[300])
class Stats(BaseModel):
computeUnits: Optional[int] = Field(None, examples=[0])
inputBodyLen: Optional[int] = Field(None, examples=[2000])
rebootCount: Optional[int] = Field(None, examples=[0])
restartCount: Optional[int] = Field(None, examples=[0])
resurrectCount: Optional[int] = Field(None, examples=[0])
class Usage(BaseModel):
ACTOR_COMPUTE_UNITS: Optional[int] = Field(None, examples=[0])
DATASET_READS: Optional[int] = Field(None, examples=[0])
DATASET_WRITES: Optional[int] = Field(None, examples=[0])
DATA_TRANSFER_EXTERNAL_GBYTES: Optional[int] = Field(None, examples=[0])
DATA_TRANSFER_INTERNAL_GBYTES: Optional[int] = Field(None, examples=[0])
KEY_VALUE_STORE_LISTS: Optional[int] = Field(None, examples=[0])
KEY_VALUE_STORE_READS: Optional[int] = Field(None, examples=[0])
KEY_VALUE_STORE_WRITES: Optional[int] = Field(None, examples=[1])
PROXY_RESIDENTIAL_TRANSFER_GBYTES: Optional[int] = Field(None, examples=[0])
PROXY_SERPS: Optional[int] = Field(None, examples=[0])
REQUEST_QUEUE_READS: Optional[int] = Field(None, examples=[0])
REQUEST_QUEUE_WRITES: Optional[int] = Field(None, examples=[0])
class UsageUsd(BaseModel):
ACTOR_COMPUTE_UNITS: Optional[int] = Field(None, examples=[0])
DATASET_READS: Optional[int] = Field(None, examples=[0])
DATASET_WRITES: Optional[int] = Field(None, examples=[0])
DATA_TRANSFER_EXTERNAL_GBYTES: Optional[int] = Field(None, examples=[0])
DATA_TRANSFER_INTERNAL_GBYTES: Optional[int] = Field(None, examples=[0])
KEY_VALUE_STORE_LISTS: Optional[int] = Field(None, examples=[0])
KEY_VALUE_STORE_READS: Optional[int] = Field(None, examples=[0])
KEY_VALUE_STORE_WRITES: Optional[float] = Field(None, examples=[5e-05])
PROXY_RESIDENTIAL_TRANSFER_GBYTES: Optional[int] = Field(None, examples=[0])
PROXY_SERPS: Optional[int] = Field(None, examples=[0])
REQUEST_QUEUE_READS: Optional[int] = Field(None, examples=[0])
REQUEST_QUEUE_WRITES: Optional[int] = Field(None, examples=[0])
class Data(BaseModel):
actId: Optional[str] = None
buildId: Optional[str] = None
buildNumber: Optional[str] = Field(None, examples=['1.0.0'])
containerUrl: Optional[str] = None
defaultDatasetId: Optional[str] = None
defaultKeyValueStoreId: Optional[str] = None
defaultRequestQueueId: Optional[str] = None
finishedAt: Optional[datetime] = Field(None, examples=['2025-01-08T00:00:00.000Z'])
id: Optional[str] = None
meta: Optional[Meta] = None
options: Optional[Options] = None
startedAt: Optional[datetime] = Field(None, examples=['2025-01-08T00:00:00.000Z'])
stats: Optional[Stats] = None
status: Optional[str] = Field(None, examples=['READY'])
usage: Optional[Usage] = None
usageTotalUsd: Optional[float] = Field(None, examples=[5e-05])
usageUsd: Optional[UsageUsd] = None
userId: Optional[str] = None
class RunsResponseSchema(BaseModel):
data: Optional[Data] = None