Skip to content

Commit 1237a10

Browse files
committed
release version 2.1.1
1 parent cf1a95e commit 1237a10

1,075 files changed

Lines changed: 6753 additions & 4777 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dataforseo_client/api/serp_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from dataforseo_client.models.serp_google_locations_country_response_info import SerpGoogleLocationsCountryResponseInfo
1818
from dataforseo_client.models.serp_google_languages_response_info import SerpGoogleLanguagesResponseInfo
1919
from dataforseo_client.models.serp_google_organic_task_post_request_info import SerpGoogleOrganicTaskPostRequestInfo
20+
from dataforseo_client.models.serp_api_stop_crawl_on_match_info import SerpApiStopCrawlOnMatchInfo
2021
from dataforseo_client.models.serp_google_organic_task_post_response_info import SerpGoogleOrganicTaskPostResponseInfo
2122
from dataforseo_client.models.serp_google_organic_tasks_ready_response_info import SerpGoogleOrganicTasksReadyResponseInfo
2223
from dataforseo_client.models.serp_tasks_ready_response_info import SerpTasksReadyResponseInfo
@@ -131,7 +132,6 @@
131132
from dataforseo_client.models.serp_bing_locations_country_response_info import SerpBingLocationsCountryResponseInfo
132133
from dataforseo_client.models.serp_bing_languages_response_info import SerpBingLanguagesResponseInfo
133134
from dataforseo_client.models.serp_bing_organic_task_post_request_info import SerpBingOrganicTaskPostRequestInfo
134-
from dataforseo_client.models.serp_api_stop_crawl_on_match_info import SerpApiStopCrawlOnMatchInfo
135135
from dataforseo_client.models.serp_bing_organic_task_post_response_info import SerpBingOrganicTaskPostResponseInfo
136136
from dataforseo_client.models.serp_bing_organic_tasks_ready_response_info import SerpBingOrganicTasksReadyResponseInfo
137137
from dataforseo_client.models.serp_bing_organic_tasks_fixed_response_info import SerpBingOrganicTasksFixedResponseInfo

dataforseo_client/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def __init__(
6262
self.default_headers[header_name] = header_value
6363
self.cookie = cookie
6464
# Set default User-Agent.
65-
self.user_agent = 'python-client/2.1.0'
65+
self.user_agent = 'python-client/2.1.1'
6666
self.client_side_validation = configuration.client_side_validation
6767

6868
def __enter__(self):

dataforseo_client/models/aggregated_metrics_info_total_info.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ class AggregatedMetricsInfoTotalInfo(BaseModel):
1515
"""
1616
AggregatedMetricsInfoTotalInfo
1717
""" # noqa: E501
18-
mentions: Optional[StrictInt] = Field(default=None, description=r"total LLM mentions count. the number of times the target keyword or domain were mentioned in relation to this specific grouping key")
19-
ai_search_volume: Optional[StrictInt] = Field(default=None, description=r"aggregated AI search volume for mentions within this grouping. learn more about this metric here")
18+
mentions: Optional[StrictInt] = Field(default=None, description=r"*total LLM mentions count*. the number of times the target keyword or domain were mentioned in relation to this specific grouping key")
19+
ai_search_volume: Optional[StrictInt] = Field(default=None, description=r"*aggregated AI search volume for mentions within this grouping*. learn more about this metric [here](https://dataforseo.com/help-center/how-the-ai-search-volume-metric-works-in-llm-mentions)")
2020
__properties: ClassVar[List[str]] = [
2121
"mentions",
2222
"ai_search_volume",

dataforseo_client/models/aggregated_metrics_item_info.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ class AggregatedMetricsItemInfo(BaseModel):
1515
"""
1616
AggregatedMetricsItemInfo
1717
""" # noqa: E501
18-
key: Optional[StrictStr] = Field(default=None, description=r"grouping identifier. the specific identifier for the grouping dimension")
19-
mentions: Optional[StrictInt] = Field(default=None, description=r"total LLM mentions count. the number of times the target keyword or domain were mentioned in relation to this specific grouping key")
20-
ai_search_volume: Optional[StrictInt] = Field(default=None, description=r"aggregated AI search volume for mentions within this grouping. learn more about this metric here")
18+
key: Optional[StrictStr] = Field(default=None, description=r"*grouping identifier*. the specific identifier for the grouping dimension")
19+
mentions: Optional[StrictInt] = Field(default=None, description=r"*total LLM mentions count*. the number of times the target keyword or domain were mentioned in relation to this specific grouping key")
20+
ai_search_volume: Optional[StrictInt] = Field(default=None, description=r"*aggregated AI search volume for mentions within this grouping*. learn more about this metric [here](https://dataforseo.com/help-center/how-the-ai-search-volume-metric-works-in-llm-mentions)")
2121
__properties: ClassVar[List[str]] = [
2222
"key",
2323
"mentions",

dataforseo_client/models/ai_mode_ai_overview_expanded_component_info.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ class AiModeAiOverviewExpandedComponentInfo(BaseModel):
1919
AiModeAiOverviewExpandedComponentInfo
2020
""" # noqa: E501
2121
type: Optional[StrictStr] = Field(default=None, description=r"type of element")
22-
title: Optional[StrictStr] = Field(default=None, description=r"reference page title")
23-
text: Optional[StrictStr] = Field(default=None, description=r"additional text of the element in SERP")
24-
markdown: Optional[StrictStr] = Field(default=None, description=r"content of the element in markdown format")
25-
images: Optional[List[Optional[AiModeImagesElementInfo]]] = Field(default=None, description=r"images of the componentif there are none, equals null")
26-
links: Optional[List[Optional[AiModeLinkElementInfo]]] = Field(default=None, description=r"sitelinksthe links shown below some of Google's search resultsif there are none, equals null")
27-
references: Optional[List[Optional[AiModeAiOverviewReferenceInfo]]] = Field(default=None, description=r"references relevant to the elementincludes references to webpages that were used to generate the ai_overview_element")
22+
title: Optional[StrictStr] = Field(default=None, description=r"*reference page title*")
23+
text: Optional[StrictStr] = Field(default=None, description=r"*additional text of the element in SERP*")
24+
markdown: Optional[StrictStr] = Field(default=None, description=r"*content of the element in markdown format*")
25+
images: Optional[List[Optional[AiModeImagesElementInfo]]] = Field(default=None, description=r"*images of the component*. if there are none, equals `null`")
26+
links: Optional[List[Optional[AiModeLinkElementInfo]]] = Field(default=None, description=r"*sitelinks*. the links shown below some of Google's search results. if there are none, equals `null`")
27+
references: Optional[List[Optional[AiModeAiOverviewReferenceInfo]]] = Field(default=None, description=r"*references relevant to the element*. includes references to webpages that were used to generate the `ai_overview_element`")
2828
__properties: ClassVar[List[str]] = [
2929
"type",
3030
"title",

dataforseo_client/models/ai_mode_ai_overview_info.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ class AiModeAiOverviewInfo(BaseModel):
1919
AiModeAiOverviewInfo
2020
""" # noqa: E501
2121
type: Optional[StrictStr] = Field(default=None, description=r"type of element")
22-
rank_group: Optional[StrictInt] = Field(default=None, description=r"group rank in SERPposition within a group of elements with identical type valuespositions of elements with different type values are omitted from rank_group")
23-
rank_absolute: Optional[StrictInt] = Field(default=None, description=r"absolute rank in SERPabsolute position among all the elements in SERP")
24-
page: Optional[StrictInt] = Field(default=None, description=r"SERP pageSERP page on which the element ranks")
25-
position: Optional[StrictStr] = Field(default=None, description=r"the alignment of the element in SERPcan take the following values:left, right")
26-
xpath: Optional[StrictStr] = Field(default=None, description=r"the XPath of the element")
27-
markdown: Optional[StrictStr] = Field(default=None, description=r"content of the element in markdown formatthe text of the ai_overview formatted in the markdown markup language")
28-
items: Optional[List[Optional[BaseSerpApiAiModeAiOverviewElementItem]]] = Field(default=None, description=r"elements of search results found in SERP")
29-
references: Optional[List[Optional[AiModeAiOverviewReferenceInfo]]] = Field(default=None, description=r"additional references relevant to the itemincludes references to webpages that may have been used to generate the ai_overview")
30-
rectangle: Optional[AiModeRectangleInfo] = Field(default=None, description=r"rectangle parameterscontains cartesian coordinates and pixel dimensions of the result's snippet in SERPequals null if calculate_rectangles in the POST request is not set to true")
22+
rank_group: Optional[StrictInt] = Field(default=None, description=r"*group rank in SERP*. position within a group of elements with identical `type` values. positions of elements with different `type` values are omitted from `rank_group`")
23+
rank_absolute: Optional[StrictInt] = Field(default=None, description=r"*absolute rank in SERP*. absolute position among all the elements in SERP")
24+
page: Optional[StrictInt] = Field(default=None, description=r"*SERP page*. SERP page on which the element ranks")
25+
position: Optional[StrictStr] = Field(default=None, description=r"*the alignment of the element in SERP*. can take the following values:. `left`, `right`")
26+
xpath: Optional[StrictStr] = Field(default=None, description=r"*the [XPath](https://en.wikipedia.org/wiki/XPath) of the element*")
27+
markdown: Optional[StrictStr] = Field(default=None, description=r"*content of the element in markdown format*. the text of the `ai_overview` formatted in the [markdown markup language](https://en.wikipedia.org/wiki/Markdown)")
28+
items: Optional[List[Optional[BaseSerpApiAiModeAiOverviewElementItem]]] = Field(default=None, description=r"*items present in the element*")
29+
references: Optional[List[Optional[AiModeAiOverviewReferenceInfo]]] = Field(default=None, description=r"*additional references relevant to the item*. includes references to webpages that may have been used to generate the `ai_overview`")
30+
rectangle: Optional[AiModeRectangleInfo] = Field(default=None, description=r"*rectangle parameters*. contains cartesian coordinates and pixel dimensions of the result's snippet in SERP. equals `null` if `calculate_rectangles` in the POST request is not set to `true`")
3131
__properties: ClassVar[List[str]] = [
3232
"type",
3333
"rank_group",
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
from __future__ import annotations
2+
import pprint
3+
import re # noqa: F401
4+
import json
5+
6+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, StrictBool
7+
from typing import Any, ClassVar, Dict, List, Optional, Union
8+
from typing import Optional, Set, Any, Dict, List
9+
from typing_extensions import Self
10+
11+
from dataforseo_client.models.ai_mode_images_element_info import AiModeImagesElementInfo
12+
13+
14+
15+
class AiModeAiOverviewPaidElementInfo(BaseModel):
16+
"""
17+
AiModeAiOverviewPaidElementInfo
18+
""" # noqa: E501
19+
type: Optional[StrictStr] = Field(default=None, description=r"type of element")
20+
title: Optional[StrictStr] = Field(default=None, description=r"*title of the element in SERP*")
21+
url: Optional[StrictStr] = Field(default=None, description=r"*reference page URL*")
22+
domain: Optional[StrictStr] = Field(default=None, description=r"*domain name of the reference*")
23+
ad_aclk: Optional[StrictStr] = Field(default=None, description=r"*unique ad click referral parameter*. using this parameter you can get a URL of the advertisement in [Google Shopping Sellers Ad URL](https://docs.dataforseo.com/v3/merchant/google/sellers/ad_url/)")
24+
website_name: Optional[StrictStr] = Field(default=None, description=r"*displayed name of the advertiser's website*")
25+
breadcrumb: Optional[StrictStr] = Field(default=None, description=r"*breadcrumb path displayed in the ad*")
26+
snippet: Optional[StrictStr] = Field(default=None, description=r"*description text of the ad*")
27+
images: Optional[List[Optional[AiModeImagesElementInfo]]] = Field(default=None, description=r"*images present in the ad*. if there are none, equals `null`")
28+
__properties: ClassVar[List[str]] = [
29+
"type",
30+
"title",
31+
"url",
32+
"domain",
33+
"ad_aclk",
34+
"website_name",
35+
"breadcrumb",
36+
"snippet",
37+
"images",
38+
]
39+
40+
additional_properties: Dict[str, Any] = Field(default_factory=dict)
41+
42+
model_config = ConfigDict(
43+
populate_by_name=True,
44+
validate_assignment=True,
45+
protected_namespaces=(),
46+
)
47+
48+
def to_str(self) -> str:
49+
return pprint.pformat(self.model_dump(by_alias=True))
50+
51+
def to_json(self) -> str:
52+
return json.dumps(self.to_dict())
53+
54+
@classmethod
55+
def from_json(cls, json_str: str) -> Optional[Self]:
56+
return cls.from_dict(json.loads(json_str))
57+
58+
def to_dict(self) -> Dict[str, Any]:
59+
excluded_fields: Set[str] = set([
60+
])
61+
62+
_dict = {}
63+
64+
_dict['type'] = self.type
65+
_dict['title'] = self.title
66+
_dict['url'] = self.url
67+
_dict['domain'] = self.domain
68+
_dict['ad_aclk'] = self.ad_aclk
69+
_dict['website_name'] = self.website_name
70+
_dict['breadcrumb'] = self.breadcrumb
71+
_dict['snippet'] = self.snippet
72+
images_items = []
73+
if self.images:
74+
for _item in self.images:
75+
if _item:
76+
images_items.append(_item.to_dict())
77+
_dict['images'] = images_items
78+
return _dict
79+
80+
81+
@classmethod
82+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83+
if obj is None:
84+
return None
85+
86+
if not isinstance(obj, dict):
87+
return cls.model_validate(obj)
88+
89+
_obj = cls.model_validate({
90+
"type": obj.get("type"),
91+
"title": obj.get("title"),
92+
"url": obj.get("url"),
93+
"domain": obj.get("domain"),
94+
"ad_aclk": obj.get("ad_aclk"),
95+
"website_name": obj.get("website_name"),
96+
"breadcrumb": obj.get("breadcrumb"),
97+
"snippet": obj.get("snippet"),
98+
"images": [AiModeImagesElementInfo.from_dict(_item) for _item in obj["images"]] if obj.get("images") is not None else None,
99+
})
100+
101+
additional_properties = {k: v for k, v in obj.items() if k not in cls.__properties}
102+
_obj.additional_properties = additional_properties
103+
return _obj

dataforseo_client/models/ai_mode_ai_overview_shopping_element_info.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ class AiModeAiOverviewShoppingElementInfo(BaseModel):
1818
AiModeAiOverviewShoppingElementInfo
1919
""" # noqa: E501
2020
type: Optional[StrictStr] = Field(default=None, description=r"type of element")
21-
product_id: Optional[StrictStr] = Field(default=None, description=r"unique product identifier on Google Shoppinglearn more about the parameter in this help center guide")
22-
data_docid: Optional[StrictStr] = Field(default=None, description=r"unique identifier of the SERP data element")
23-
gid: Optional[StrictStr] = Field(default=None, description=r"global product identifier on Google Shoppinglearn more about the parameter in this help center guide")
24-
title: Optional[StrictStr] = Field(default=None, description=r"reference page title")
25-
url: Optional[StrictStr] = Field(default=None, description=r"URL in link")
26-
domain: Optional[StrictStr] = Field(default=None, description=r"domain in link")
27-
rating: Optional[RatingInfo] = Field(default=None, description=r"product rating the popularity rate based on reviews if there is none, the value will be null")
28-
price: Optional[PriceInfo] = Field(default=None, description=r"product priceproduct price details on the seller's website; if there is none, the value will be null")
29-
seller: Optional[StrictStr] = Field(default=None, description=r"product sellername of the product's seller as displayed in search results")
30-
snippet: Optional[StrictStr] = Field(default=None, description=r"additional information about the result")
31-
marketplace: Optional[StrictStr] = Field(default=None, description=r"merchant account providere-commerce site that hosts products or websites of individual sellers under the same merchant accountexample:by Google")
32-
marketplace_url: Optional[StrictStr] = Field(default=None, description=r"URL to the merchant account providere-commerce site that hosts products or websites of individual sellers under the same merchant account")
33-
image_url: Optional[StrictStr] = Field(default=None, description=r"URL of the imagethe URL leading to the image on the original resource or DataForSEO storage (in case the original source is not available)")
21+
product_id: Optional[StrictStr] = Field(default=None, description=r"*unique product identifier on Google Shopping*. learn more about the parameter in [this help center guide](https://dataforseo.com/help-center/product-id-google-shopping)")
22+
data_docid: Optional[StrictStr] = Field(default=None, description=r"*unique identifier of the SERP data element*")
23+
gid: Optional[StrictStr] = Field(default=None, description=r"*global product identifier on Google Shopping*. learn more about the parameter in [this help center guide](https://dataforseo.com/help-center/whats-a-gid-in-google-shopping-api)")
24+
title: Optional[StrictStr] = Field(default=None, description=r"*reference page title*")
25+
url: Optional[StrictStr] = Field(default=None, description=r"*URL in link*")
26+
domain: Optional[StrictStr] = Field(default=None, description=r"*domain in link*")
27+
rating: Optional[RatingInfo] = Field(default=None, description=r"*product rating*. the popularity rate based on reviews. if there is none, the value will be `null`")
28+
price: Optional[PriceInfo] = Field(default=None, description=r"*product price*. product price details on the seller's website;. if there is none, the value will be `null`")
29+
seller: Optional[StrictStr] = Field(default=None, description=r"*product seller*. name of the product's seller as displayed in search results")
30+
snippet: Optional[StrictStr] = Field(default=None, description=r"*additional information about the result*")
31+
marketplace: Optional[StrictStr] = Field(default=None, description=r"*merchant account provider*. e-commerce site that hosts products or websites of individual sellers under the same merchant account. example:. `by Google`")
32+
marketplace_url: Optional[StrictStr] = Field(default=None, description=r"*URL to the merchant account provider*. e-commerce site that hosts products or websites of individual sellers under the same merchant account")
33+
image_url: Optional[StrictStr] = Field(default=None, description=r"*URL of the image*. the URL leading to the image on the original resource or DataForSEO storage (in case the original source is not available)")
3434
__properties: ClassVar[List[str]] = [
3535
"type",
3636
"product_id",

dataforseo_client/models/ai_mode_link_element_info.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ class AiModeLinkElementInfo(BaseModel):
1616
AiModeLinkElementInfo
1717
""" # noqa: E501
1818
type: Optional[StrictStr] = Field(default=None, description=r"type of element")
19-
title: Optional[StrictStr] = Field(default=None, description=r"title of the element")
20-
description: Optional[StrictStr] = Field(default=None, description=r"link description")
21-
url: Optional[StrictStr] = Field(default=None, description=r"search URL with refinement parameters")
22-
domain: Optional[StrictStr] = Field(default=None, description=r"domain in SERP")
19+
title: Optional[StrictStr] = Field(default=None, description=r"*title of the element*")
20+
description: Optional[StrictStr] = Field(default=None, description=r"*link description*")
21+
url: Optional[StrictStr] = Field(default=None, description=r"*search URL with refinement parameters*")
22+
domain: Optional[StrictStr] = Field(default=None, description=r"*domain in SERP*")
2323
__properties: ClassVar[List[str]] = [
2424
"type",
2525
"title",

0 commit comments

Comments
 (0)