Skip to content

Commit cf1a95e

Browse files
committed
release version 2.1.0
1 parent 5dc3075 commit cf1a95e

1,119 files changed

Lines changed: 16765 additions & 6218 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/ai_optimization_api.py

Lines changed: 2861 additions & 921 deletions
Large diffs are not rendered by default.

dataforseo_client/api/business_data_api.py

Lines changed: 0 additions & 194 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@
8080
from dataforseo_client.models.business_data_tripadvisor_reviews_task_get_response_info import BusinessDataTripadvisorReviewsTaskGetResponseInfo
8181
from dataforseo_client.models.business_data_social_media_pinterest_live_request_info import BusinessDataSocialMediaPinterestLiveRequestInfo
8282
from dataforseo_client.models.business_data_social_media_pinterest_live_response_info import BusinessDataSocialMediaPinterestLiveResponseInfo
83-
from dataforseo_client.models.business_data_social_media_reddit_live_request_info import BusinessDataSocialMediaRedditLiveRequestInfo
84-
from dataforseo_client.models.business_data_social_media_reddit_live_response_info import BusinessDataSocialMediaRedditLiveResponseInfo
8583

8684
from dataforseo_client.api_client import ApiClient, RequestSerialized
8785
from dataforseo_client.api_response import ApiResponse
@@ -9400,196 +9398,4 @@ def _social_media_pinterest_live_serialize(
94009398
collection_formats=_collection_formats,
94019399
_host=_host,
94029400
_request_auth=_request_auth
9403-
)
9404-
9405-
from dataforseo_client.models.business_data_social_media_reddit_live_request_info import BusinessDataSocialMediaRedditLiveRequestInfo
9406-
from dataforseo_client.models.business_data_social_media_reddit_live_response_info import BusinessDataSocialMediaRedditLiveResponseInfo
9407-
@validate_call
9408-
def social_media_reddit_live(
9409-
self,
9410-
list_optional_business_data_social_media_reddit_live_request_info: 'List[Optional[BusinessDataSocialMediaRedditLiveRequestInfo]]' = None,
9411-
_request_timeout: Union[
9412-
None,
9413-
Annotated[StrictFloat, Field(gt=0)],
9414-
Tuple[
9415-
Annotated[StrictFloat, Field(gt=0)],
9416-
Annotated[StrictFloat, Field(gt=0)]
9417-
]
9418-
] = None,
9419-
_request_auth: Optional[Dict[StrictStr, Any]] = None,
9420-
_content_type: Optional[StrictStr] = None,
9421-
_headers: Optional[Dict[StrictStr, Any]] = None,
9422-
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
9423-
) -> BusinessDataSocialMediaRedditLiveResponseInfo:
9424-
9425-
_param = self._social_media_reddit_live_serialize(
9426-
list_optional_business_data_social_media_reddit_live_request_info=list_optional_business_data_social_media_reddit_live_request_info,
9427-
_request_auth=_request_auth,
9428-
_content_type=_content_type,
9429-
_headers=_headers,
9430-
_host_index=_host_index
9431-
)
9432-
9433-
_response_types_map: Dict[str, Optional[str]] = {
9434-
'200': "BusinessDataSocialMediaRedditLiveResponseInfo",
9435-
}
9436-
response_data = self.api_client.call_api(
9437-
*_param,
9438-
_request_timeout=_request_timeout
9439-
)
9440-
response_data.read()
9441-
return self.api_client.response_deserialize(
9442-
response_data=response_data,
9443-
response_types_map=_response_types_map,
9444-
).data
9445-
9446-
9447-
9448-
@validate_call
9449-
def social_media_reddit_live_with_http_info(
9450-
self,
9451-
list_optional_business_data_social_media_reddit_live_request_info: 'List[Optional[BusinessDataSocialMediaRedditLiveRequestInfo]]' = None,
9452-
_request_timeout: Union[
9453-
None,
9454-
Annotated[StrictFloat, Field(gt=0)],
9455-
Tuple[
9456-
Annotated[StrictFloat, Field(gt=0)],
9457-
Annotated[StrictFloat, Field(gt=0)]
9458-
]
9459-
] = None,
9460-
_request_auth: Optional[Dict[StrictStr, Any]] = None,
9461-
_content_type: Optional[StrictStr] = None,
9462-
_headers: Optional[Dict[StrictStr, Any]] = None,
9463-
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
9464-
) -> 'ApiResponse[BusinessDataSocialMediaRedditLiveResponseInfo]':
9465-
9466-
_param = self._social_media_reddit_live_serialize(
9467-
list_optional_business_data_social_media_reddit_live_request_info=list_optional_business_data_social_media_reddit_live_request_info,
9468-
_request_auth=_request_auth,
9469-
_content_type=_content_type,
9470-
_headers=_headers,
9471-
_host_index=_host_index
9472-
)
9473-
9474-
_response_types_map: Dict[str, Optional[str]] = {
9475-
'200': "BusinessDataSocialMediaRedditLiveResponseInfo",
9476-
}
9477-
response_data = self.api_client.call_api(
9478-
*_param,
9479-
_request_timeout=_request_timeout
9480-
)
9481-
response_data.read()
9482-
return self.api_client.response_deserialize(
9483-
response_data=response_data,
9484-
response_types_map=_response_types_map,
9485-
)
9486-
9487-
9488-
@validate_call
9489-
def social_media_reddit_live_without_preload_content(
9490-
self,
9491-
list_optional_business_data_social_media_reddit_live_request_info: 'List[Optional[BusinessDataSocialMediaRedditLiveRequestInfo]]' = None,
9492-
_request_timeout: Union[
9493-
None,
9494-
Annotated[StrictFloat, Field(gt=0)],
9495-
Tuple[
9496-
Annotated[StrictFloat, Field(gt=0)],
9497-
Annotated[StrictFloat, Field(gt=0)]
9498-
]
9499-
] = None,
9500-
_request_auth: Optional[Dict[StrictStr, Any]] = None,
9501-
_content_type: Optional[StrictStr] = None,
9502-
_headers: Optional[Dict[StrictStr, Any]] = None,
9503-
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
9504-
) -> RESTResponseType:
9505-
9506-
_param = self._social_media_reddit_live_serialize(
9507-
list_optional_business_data_social_media_reddit_live_request_info=list_optional_business_data_social_media_reddit_live_request_info,
9508-
_request_auth=_request_auth,
9509-
_content_type=_content_type,
9510-
_headers=_headers,
9511-
_host_index=_host_index
9512-
)
9513-
9514-
_response_types_map: Dict[str, Optional[str]] = {
9515-
'200': "BusinessDataSocialMediaRedditLiveResponseInfo",
9516-
}
9517-
response_data = self.api_client.call_api(
9518-
*_param,
9519-
_request_timeout=_request_timeout
9520-
)
9521-
return response_data.response
9522-
9523-
9524-
def _social_media_reddit_live_serialize(
9525-
self,
9526-
list_optional_business_data_social_media_reddit_live_request_info,
9527-
_request_auth,
9528-
_content_type,
9529-
_headers,
9530-
_host_index,
9531-
) -> RequestSerialized:
9532-
9533-
_host = None
9534-
9535-
_collection_formats: Dict[str, str] = {
9536-
'List[Optional[BusinessDataSocialMediaRedditLiveRequestInfo]]': '',
9537-
}
9538-
9539-
_path_params: Dict[str, str] = {}
9540-
_query_params: List[Tuple[str, str]] = []
9541-
_header_params: Dict[str, Optional[str]] = _headers or {}
9542-
_form_params: List[Tuple[str, str]] = []
9543-
_files: Dict[str, Union[str, bytes]] = {}
9544-
_body_params: Optional[bytes] = None
9545-
9546-
# process the path parameters
9547-
# process the query parameters
9548-
# process the header parameters
9549-
# process the form parameters
9550-
# process the body parameter
9551-
if list_optional_business_data_social_media_reddit_live_request_info is not None:
9552-
_body_params = list_optional_business_data_social_media_reddit_live_request_info
9553-
9554-
9555-
# set the HTTP header `Accept`
9556-
if 'Accept' not in _header_params:
9557-
_header_params['Accept'] = self.api_client.select_header_accept(
9558-
[
9559-
'application/json'
9560-
]
9561-
)
9562-
9563-
# set the HTTP header `Content-Type`
9564-
if _content_type:
9565-
_header_params['Content-Type'] = _content_type
9566-
else:
9567-
_default_content_type = (
9568-
self.api_client.select_header_content_type(
9569-
[
9570-
'application/json'
9571-
]
9572-
)
9573-
)
9574-
if _default_content_type is not None:
9575-
_header_params['Content-Type'] = _default_content_type
9576-
9577-
# authentication setting
9578-
_auth_settings: List[str] = [
9579-
'basicAuth'
9580-
]
9581-
9582-
return self.api_client.param_serialize(
9583-
method='POST',
9584-
resource_path='/v3/business_data/social_media/reddit/live',
9585-
path_params=_path_params,
9586-
query_params=_query_params,
9587-
header_params=_header_params,
9588-
body=_body_params,
9589-
post_params=_form_params,
9590-
files=_files,
9591-
auth_settings=_auth_settings,
9592-
collection_formats=_collection_formats,
9593-
_host=_host,
9594-
_request_auth=_request_auth
95959401
)

dataforseo_client/api/serp_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
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
2120
from dataforseo_client.models.serp_google_organic_task_post_response_info import SerpGoogleOrganicTaskPostResponseInfo
2221
from dataforseo_client.models.serp_google_organic_tasks_ready_response_info import SerpGoogleOrganicTasksReadyResponseInfo
2322
from dataforseo_client.models.serp_tasks_ready_response_info import SerpTasksReadyResponseInfo
@@ -132,6 +131,7 @@
132131
from dataforseo_client.models.serp_bing_locations_country_response_info import SerpBingLocationsCountryResponseInfo
133132
from dataforseo_client.models.serp_bing_languages_response_info import SerpBingLanguagesResponseInfo
134133
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.0.26'
65+
self.user_agent = 'python-client/2.1.0'
6666
self.client_side_validation = configuration.client_side_validation
6767

6868
def __enter__(self):

dataforseo_client/models/about_this_result_element.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
class AboutThisResultElement(BaseModel):
1515
"""
1616
AboutThisResultElement
17+
18+
.. deprecated::
19+
1720
""" # noqa: E501
1821
type: Optional[StrictStr] = Field(default=None, description=r"type of element")
1922
url: Optional[StrictStr] = Field(default=None, description=r"result’s URL")

dataforseo_client/models/absolute_items.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class AbsoluteItems(BaseModel):
1717
""" # noqa: E501
1818
geo_id: Optional[StrictStr] = Field(default=None, description=r"location identifier. you can use this field for matching obtained results with location parameters specified in the request. see the full list of available locations with their geo_id here or by making a separate request to https://api.dataforseo.com/v3/keywords_data/dataforseo_trends/locations. example:. US-NY")
1919
geo_name: Optional[StrictStr] = Field(default=None, description=r"location name. you can use this field for matching obtained results with location parameters specified in the request. see the full list of available locations with their geo_name here or by making a separate request to https://api.dataforseo.com/v3/keywords_data/dataforseo_trends/locations. example:. Andorra")
20-
values: Optional[List[Optional[StrictStr]]] = Field(default=None, description=r"keyword popularity rates within a given location. represents location-specific keyword popularity rate over the specified time range;. using these values, you can understand which of the specified keywords is more popular in the related location;. the first value in the array is provided for the first term from the keywords array, the second value is provided for the second keyword, and so on;. calculation: we determine the highest popularity value across all specified keywords within a given location, and then express the popularity values of each keyword as a percentage of the highest value (100);. a value of 100 is the peak popularity for the term. a value of 50 means that the term is half as popular. a value of 0 means there was not enough data for this term")
20+
values: Optional[List[Optional[StrictStr]]] = Field(default=None, description=r"contains data on relative keyword popularity by country or region")
2121
__properties: ClassVar[List[str]] = [
2222
"geo_id",
2323
"geo_name",

dataforseo_client/models/ad_link_element.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class AdLinkElement(BaseModel):
1616
AdLinkElement
1717
""" # noqa: E501
1818
type: Optional[StrictStr] = Field(default=None, description=r"type of element")
19-
title: Optional[StrictStr] = Field(default=None, description=r"reference page title")
20-
description: Optional[StrictStr] = Field(default=None, description=r"link description")
19+
title: Optional[StrictStr] = Field(default=None, description=r"title of the element in SERP")
20+
description: Optional[StrictStr] = Field(default=None, description=r"description of the link")
2121
url: Optional[StrictStr] = Field(default=None, description=r"reference page URL")
2222
domain: Optional[StrictStr] = Field(default=None, description=r"domain where a link points")
2323
ad_aclk: Optional[StrictStr] = Field(default=None, description=r"the identifier of the ad")
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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+
12+
13+
14+
class AggregatedMetricsInfoTotalInfo(BaseModel):
15+
"""
16+
AggregatedMetricsInfoTotalInfo
17+
""" # 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")
20+
__properties: ClassVar[List[str]] = [
21+
"mentions",
22+
"ai_search_volume",
23+
]
24+
25+
additional_properties: Dict[str, Any] = Field(default_factory=dict)
26+
27+
model_config = ConfigDict(
28+
populate_by_name=True,
29+
validate_assignment=True,
30+
protected_namespaces=(),
31+
)
32+
33+
def to_str(self) -> str:
34+
return pprint.pformat(self.model_dump(by_alias=True))
35+
36+
def to_json(self) -> str:
37+
return json.dumps(self.to_dict())
38+
39+
@classmethod
40+
def from_json(cls, json_str: str) -> Optional[Self]:
41+
return cls.from_dict(json.loads(json_str))
42+
43+
def to_dict(self) -> Dict[str, Any]:
44+
excluded_fields: Set[str] = set([
45+
])
46+
47+
_dict = {}
48+
49+
_dict['mentions'] = self.mentions
50+
_dict['ai_search_volume'] = self.ai_search_volume
51+
return _dict
52+
53+
54+
@classmethod
55+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
56+
if obj is None:
57+
return None
58+
59+
if not isinstance(obj, dict):
60+
return cls.model_validate(obj)
61+
62+
_obj = cls.model_validate({
63+
"mentions": obj.get("mentions"),
64+
"ai_search_volume": obj.get("ai_search_volume"),
65+
})
66+
67+
additional_properties = {k: v for k, v in obj.items() if k not in cls.__properties}
68+
_obj.additional_properties = additional_properties
69+
return _obj

0 commit comments

Comments
 (0)