Skip to main content

data_for_seo/entity/serp/google/
auto_complete.rs

1use crate::entity::SerpApiElementRefinementChips;
2use crate::entity::serp::element::SerpApiElementAutocomplete;
3use serde::{Deserialize, Serialize};
4use serde_json::Value;
5
6/// Google Auto Complete SERP data model.
7#[derive(Debug, Default, Serialize, Deserialize, Clone)]
8pub struct SerpApiGoogleAutoComplete<T> {
9    /// Search term the result was returned for.
10    pub keyword: String,
11    /// Search engine result type (the API `type` field).
12    #[serde(rename = "type")]
13    pub search_engine_type: Option<String>,
14    /// Search-engine domain the results were taken from.
15    pub se_domain: Option<String>,
16    /// DataForSEO location code the search was run for.
17    pub location_code: i32,
18    /// Language code the search was run for.
19    pub language_code: Option<String>,
20    /// Direct URL to reproduce the search on the search engine.
21    pub check_url: Option<String>,
22    /// UTC timestamp when the result was received.
23    pub datetime: Option<String>,
24    /// Search-engine spelling correction applied to the query, if any.
25    pub spell: Option<Value>,
26    /// Search-refinement chips shown for the query.
27    pub refinement_chips: Option<SerpApiElementRefinementChips>,
28    /// Distinct element types present in the returned SERP.
29    pub item_types: Option<Vec<String>>,
30    /// Total number of results reported by the search engine.
31    pub se_results_count: Option<i64>,
32    /// Number of items returned in this result.
33    pub items_count: Option<i64>,
34    /// Parsed elements of the result.
35    pub items: Option<Vec<T>>,
36}
37
38/// Google Autocomplete Advanced result type.
39pub type SerpApiGoogleAutocompleteAdvanced = SerpApiGoogleAutoComplete<SerpApiElementAutocomplete>;