Struct GetNewsArchiveParams

Source
pub struct GetNewsArchiveParams {
Show 21 fields pub id: Option<Vec<String>>, pub from_date: Option<String>, pub to_date: Option<String>, pub q: Option<String>, pub q_in_title: Option<String>, pub q_in_meta: Option<String>, pub country: Option<Vec<String>>, pub category: Option<Vec<String>>, pub exclude_category: Option<Vec<String>>, pub language: Option<String>, pub domain: Option<String>, pub exclude_domain: Option<String>, pub domain_url: Option<String>, pub exclude_field: Option<String>, pub priority_domain: Option<String>, pub timezone: Option<String>, pub full_content: Option<Flag>, pub image: Option<Flag>, pub video: Option<Flag>, pub size: Option<i32>, pub page: Option<String>,
}
Expand description

Parameters for the get_news_archive method.

Fields§

§id: Option<Vec<String>>

Unique identifier of the news article.
Max no. of id could be added: 50

§from_date: Option<String>

Start date for the news articles.
If not specified, the api will fetch the data from the past 1 years if you have professional subscription.
Format: YYYY-MM-DD

§to_date: Option<String>

End date for the news articles.
If not specified, it will be today
Format: YYYY-MM-DD

§q: Option<String>

Keywords to search for in the news articles.
Max characters: 512.
Exclusive with q_in_title and q_in_meta

§q_in_title: Option<String>

Keywords to search for in the title of the news articles.
Max characters: 512.
Exclusive with q and q_in_meta

§q_in_meta: Option<String>

Keywords to search for in the meta description of the news articles.
Max characters: 512.
Exclusive with q and q_in_title

§country: Option<Vec<String>>

Country code for the news articles.
Max no. of country could be added: 5.
Examples: “hk”, “us”, “wo”

§category: Option<Vec<String>>

Category for the news articles.
Max no. of category could be added: 5.
Exclusive with exclude_category.
Possible values: “business”, “crime”, “domestic”, “education”, “entertainment”, “environment”, “food”, “health”, “lifestyle”, “other”, “politics”, “science”, “sports”, “technology”, “top”, “tourism”, “world”

§exclude_category: Option<Vec<String>>

Category to exclude from the results.
Max no. of exclude_category could be added: 5.
Exclusive with category.
Possible values: “business”, “crime”, “domestic”, “education”, “entertainment”, “environment”, “food”, “health”, “lifestyle”, “other”, “politics”, “science”, “sports”, “technology”, “top”, “tourism”, “world”

§language: Option<String>

Language code for the news articles.
Max no. of language could be added: 5.

§domain: Option<String>

Domain for the news articles.
Max no. of domain could be added: 5.
Possible values in here

§exclude_domain: Option<String>

Domain to exclude from the results.
Max no. of domain could be added: 5.
Possible values in here

§domain_url: Option<String>

Domain URL for the news articles.
Max no. of domain could be added: 5.

§exclude_field: Option<String>

Field to exclude from the results.
“article_id” is not excludable in response

§priority_domain: Option<String>

Priority domain for the news articles.
Top: Fetches news articles from the top 10% of the news domains
Medium: Fetches news articles from the top 30% of the news domains. It means it already includes all the news articles of “top” priority.
Low: Fetches news articles from the top 50% of the news domains. It means it already includes all the news articles of “top” and “medium” priorities.

§timezone: Option<String>

Timezone for the news articles.

§full_content: Option<Flag>

Whether to include full content in the results.

§image: Option<Flag>

Whether to include images in the results.

§video: Option<Flag>

Whether to include videos in the results.

§size: Option<i32>

Number of results to return.
Could only be 1 to 50

§page: Option<String>

page parameter from last result
Detail

Implementations§

Source§

impl GetNewsArchiveParams

Source

pub fn default() -> Self

Creates a new GetNewsArchiveParams with default values.

This method sets the default values for all parameters, which are:

  • id: None
  • q: None
  • q_in_title: None
  • q_in_meta: None
  • country: None
  • category: None
  • exclude_category: None
  • language: None
  • domain: None
  • exclude_domain: None
  • domain_url: None
  • exclude_field: None
  • priority_domain: None
  • timezone: None
  • full_content: None
  • image: None
  • video: None
  • size: None
  • page: None
  • from_date: None
  • to_date: None

This allows you to easily create a GetNewsArchiveParams object without having to specify all the parameters manually.

Trait Implementations§

Source§

impl Debug for GetNewsArchiveParams

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for GetNewsArchiveParams

Source§

fn default() -> GetNewsArchiveParams

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,