api

package module
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2025 License: MIT Imports: 7 Imported by: 0

README

Newscatcher Go Library

fern shield go shield

The Newscatcher Go library lets you access the Newscatcher API from Go.

Documentation

Find the complete API reference here.

Requirements

This module requires Go version >= 1.13.

Installation

Run this command to use the Newscatcher Go library in your module:

go get github.com/Newscatcher/newscatcher-go

Usage

Build and use the client like this:

import (
    "context"
    newscatcher "github.com/Newscatcher/newscatcher-go"
    newscatcherclient "github.com/Newscatcher/newscatcher-go/client"
    "github.com/Newscatcher/newscatcher-go/option"
)

client := newscatcherclient.NewClient(
    option.WithApiKey("YOUR_API_KEY"),
)

response, err := client.Search.Post(
    context.TODO(),
 &newscatcher.SearchPostRequest{
        Q: "renewable energy",
        PredefinedSources: []string{"top 50 US"},
        Lang: []string{"en"},
        From: "2024-01-01",
        To: "2024-06-30",
 },
)

Error Handling

When the API responds with a non-success status code, the SDK returns an error.

import (
    "github.com/Newscatcher/newscatcher-go/core"
    "fmt"
)

response, err := client.Search.Post(...)
if err != nil {
    if apiErr, ok := err.(*core.APIError); ok {
        fmt.Println(apiErr.Error())
        fmt.Println(apiErr.StatusCode)
 }
    return err
}

You can use Go's standard error handling features with these errors:

import (
    import "errors"
    newscatcher "github.com/Newscatcher/newscatcher-go"
)

response, err := client.Search.Post(...)
if err != nil {
    var badRequestErr *newscatcher.BadRequestError
    if errors.As(err, &badRequestErr) {
        // Handle bad request
        fmt.Println(badRequestErr.Error())
 }
    // Wrap error with additional context
    return fmt.Errorf("search failed: %w", err)
}

The SDK provides specific error types for different cases:

response, err := client.Search.Post(...)
if err != nil {
    switch e := err.(type) {
    case *newscatcher.BadRequestError:
        // Handle 400 error - Invalid request parameters
    case *newscatcher.UnauthorizedError:
        // Handle 401 error - Authentication failed
    case *newscatcher.ForbiddenError:
        // Handle 403 error - Server refuses action
    case *newscatcher.RequestTimeoutError:
        // Handle 408 error - Request timeout
    case *newscatcher.UnprocessableEntityError:
        // Handle 422 error - Validation error
    case *newscatcher.TooManyRequestsError:
        // Handle 429 error - Rate limit exceeded
    case *newscatcher.InternalServerError:
        // Handle 500 error - Server error
    default:
        return err
 }
}

Advanced Features

Retries

The SDK automatically retries failed requests with exponential backoff. When a request fails with any of these status codes, the SDK retries up to 2 times:

  • 408 (Timeout)
  • 429 (Too Many Requests)
  • 5XX (Internal Server Errors)

You can use the option.WithMaxAttempts option to configure the maximum retry limit to your liking. For example, if you want to disable retries for the client entirely, you can set this value to 1 like so:

client := newscatcherclient.NewClient(
    option.WithMaxAttempts(1),
)

This can be done for an individual request, too:

response, err := client.Search.Post(
    context.TODO(),
    ...,
    option.WithMaxAttempts(1),
)
Timeouts

Set timeouts using the standard context package:

ctx, cancel := context.WithTimeout(context.TODO(), time.Second)
defer cancel()

response, err := client.Search.Post(
    ctx,
    request,
)
Request Options

Configure the client using options at initialization or per request:

// Client-level configuration
client := newscatcherclient.NewClient(
    option.WithApiKey("YOUR_API_KEY"),
    option.WithHTTPClient(&http.Client{
        Timeout: 30 * time.Second,
    }),
    option.WithMaxAttempts(3),
)

// Request-level configuration
response, err := client.Search.Post(
    context.TODO(),
    request,
    option.WithMaxAttempts(1),      // Override retries for this request
)

Available options include:

  • WithApiKey(string): Set authentication key.
  • WithHTTPClient(*http.Client): Use custom HTTP client.
  • WithMaxAttempts(uint): Configure retry attempts.
  • WithBaseURL(string): Override API base URL.
  • WithHTTPHeader(http.Header): Add custom headers.

Caution: We recommend using your own *http.Client. By default, the SDK uses http.DefaultClient, which waits indefinitely for responses unless you set a context-based timeout.

Contributing

We generate this SDK programmatically, so we can't accept direct code contributions. Instead:

  1. Open an issue to discuss your ideas with us first.
  2. If you want to show an implementation, create a PR as a proof of concept.
  3. We'll work with you to implement the changes in our generator.

On the other hand, contributions to the README are always very welcome!

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Environments = struct {
	Default string
}{
	Default: "https://v3-api.newscatcherapi.com",
}

Environments defines all of the API environments. These values can be used with the WithBaseURL RequestOption to override the client's default environment, if any.

Functions

func Bool

func Bool(b bool) *bool

Bool returns a pointer to the given bool value.

func Byte

func Byte(b byte) *byte

Byte returns a pointer to the given byte value.

func Complex128

func Complex128(c complex128) *complex128

Complex128 returns a pointer to the given complex128 value.

func Complex64

func Complex64(c complex64) *complex64

Complex64 returns a pointer to the given complex64 value.

func Float32

func Float32(f float32) *float32

Float32 returns a pointer to the given float32 value.

func Float64

func Float64(f float64) *float64

Float64 returns a pointer to the given float64 value.

func Int

func Int(i int) *int

Int returns a pointer to the given int value.

func Int16

func Int16(i int16) *int16

Int16 returns a pointer to the given int16 value.

func Int32

func Int32(i int32) *int32

Int32 returns a pointer to the given int32 value.

func Int64

func Int64(i int64) *int64

Int64 returns a pointer to the given int64 value.

func Int8

func Int8(i int8) *int8

Int8 returns a pointer to the given int8 value.

func MustParseDate

func MustParseDate(date string) time.Time

MustParseDate attempts to parse the given string as a date time.Time, and panics upon failure.

func MustParseDateTime

func MustParseDateTime(datetime string) time.Time

MustParseDateTime attempts to parse the given string as a datetime time.Time, and panics upon failure.

func Rune

func Rune(r rune) *rune

Rune returns a pointer to the given rune value.

func String

func String(s string) *string

String returns a pointer to the given string value.

func Time

func Time(t time.Time) *time.Time

Time returns a pointer to the given time.Time value.

func UUID

func UUID(u uuid.UUID) *uuid.UUID

UUID returns a pointer to the given uuid.UUID value.

func Uint

func Uint(u uint) *uint

Uint returns a pointer to the given uint value.

func Uint16

func Uint16(u uint16) *uint16

Uint16 returns a pointer to the given uint16 value.

func Uint32

func Uint32(u uint32) *uint32

Uint32 returns a pointer to the given uint32 value.

func Uint64

func Uint64(u uint64) *uint64

Uint64 returns a pointer to the given uint64 value.

func Uint8

func Uint8(u uint8) *uint8

Uint8 returns a pointer to the given uint8 value.

func Uintptr

func Uintptr(u uintptr) *uintptr

Uintptr returns a pointer to the given uintptr value.

Types

type AdditionalDomainInfo added in v1.1.0

type AdditionalDomainInfo = bool

If true, includes additional domain information in the response for each article: - `is_news_domain`: Boolean indicating if the source is a news domain. - `news_domain_type`: Type of news domain (e.g., `"Original Content"`). - `news_type`: Category of news (e.g., `"News and Blogs"`).

type AdditionalDomainInfoEntity added in v1.1.0

type AdditionalDomainInfoEntity struct {
	// Indicates whether the domain is a news domain.
	IsNewsDomain *bool `json:"is_news_domain,omitempty" url:"is_news_domain,omitempty"`
	// The type of news content provided by the domain.
	NewsType *string `json:"news_type,omitempty" url:"news_type,omitempty"`
	// The type of news domain.
	NewsDomainType *string `json:"news_domain_type,omitempty" url:"news_domain_type,omitempty"`
	// contains filtered or unexported fields
}

Additional information about the domain of the article.

func (*AdditionalDomainInfoEntity) GetExtraProperties added in v1.1.0

func (a *AdditionalDomainInfoEntity) GetExtraProperties() map[string]interface{}

func (*AdditionalDomainInfoEntity) GetIsNewsDomain added in v1.1.0

func (a *AdditionalDomainInfoEntity) GetIsNewsDomain() *bool

func (*AdditionalDomainInfoEntity) GetNewsDomainType added in v1.1.0

func (a *AdditionalDomainInfoEntity) GetNewsDomainType() *string

func (*AdditionalDomainInfoEntity) GetNewsType added in v1.1.0

func (a *AdditionalDomainInfoEntity) GetNewsType() *string

func (*AdditionalDomainInfoEntity) String added in v1.1.0

func (a *AdditionalDomainInfoEntity) String() string

func (*AdditionalDomainInfoEntity) UnmarshalJSON added in v1.1.0

func (a *AdditionalDomainInfoEntity) UnmarshalJSON(data []byte) error

type AdditionalSourceInfo

type AdditionalSourceInfo struct {
	// The number of articles published by the source in the last seven days.
	NbArticlesFor7D *int `json:"nb_articles_for_7d,omitempty" url:"nb_articles_for_7d,omitempty"`
	// The country of origin of the news source.
	Country *string `json:"country,omitempty" url:"country,omitempty"`
	// The SEO rank of the news source.
	Rank *int `json:"rank,omitempty" url:"rank,omitempty"`
	// Indicates whether the source is a news domain.
	IsNewsDomain *bool `json:"is_news_domain,omitempty" url:"is_news_domain,omitempty"`
	// The type of news domain.
	NewsDomainType *string `json:"news_domain_type,omitempty" url:"news_domain_type,omitempty"`
	// The category of news provided by the source.
	NewsType *string `json:"news_type,omitempty" url:"news_type,omitempty"`
	// contains filtered or unexported fields
}

The data model for additional information about a news source.

func (*AdditionalSourceInfo) GetCountry

func (a *AdditionalSourceInfo) GetCountry() *string

func (*AdditionalSourceInfo) GetExtraProperties

func (a *AdditionalSourceInfo) GetExtraProperties() map[string]interface{}

func (*AdditionalSourceInfo) GetIsNewsDomain

func (a *AdditionalSourceInfo) GetIsNewsDomain() *bool

func (*AdditionalSourceInfo) GetNbArticlesFor7D

func (a *AdditionalSourceInfo) GetNbArticlesFor7D() *int

func (*AdditionalSourceInfo) GetNewsDomainType

func (a *AdditionalSourceInfo) GetNewsDomainType() *string

func (*AdditionalSourceInfo) GetNewsType

func (a *AdditionalSourceInfo) GetNewsType() *string

func (*AdditionalSourceInfo) GetRank

func (a *AdditionalSourceInfo) GetRank() *int

func (*AdditionalSourceInfo) String

func (a *AdditionalSourceInfo) String() string

func (*AdditionalSourceInfo) UnmarshalJSON

func (a *AdditionalSourceInfo) UnmarshalJSON(data []byte) error

type AggregationBy added in v1.1.0

type AggregationBy string

The aggregation interval for the results. Possible values are: - `day`: Aggregates results by day. - `hour`: Aggregates results by hour.

const (
	AggregationByDay  AggregationBy = "day"
	AggregationByHour AggregationBy = "hour"
)

func NewAggregationByFromString added in v1.1.0

func NewAggregationByFromString(s string) (AggregationBy, error)

func (AggregationBy) Ptr added in v1.1.0

func (a AggregationBy) Ptr() *AggregationBy

type AggregationCountResponseDto added in v1.1.0

type AggregationCountResponseDto struct {
	// The status of the response.
	Status string `json:"status" url:"status"`
	// The total number of articles matching the search criteria.
	TotalHits int `json:"total_hits" url:"total_hits"`
	// The current page number of the results.
	Page int `json:"page" url:"page"`
	// The total number of pages available for the given search criteria.
	TotalPages int `json:"total_pages" url:"total_pages"`
	// The number of articles per page.
	PageSize int `json:"page_size" url:"page_size"`
	// The aggregation results. Can be either a dictionary or a list of dictionaries.
	Aggregations *Aggregations `json:"aggregations,omitempty" url:"aggregations,omitempty"`
	UserInput    *UserInputDto `json:"user_input,omitempty" url:"user_input,omitempty"`
	// contains filtered or unexported fields
}

The response model for a successful `Aggregation count` request. Response field behavior: - Required fields are guaranteed to be present and non-null. - Optional fields may be `null`/`undefined` if the data couldn't be extracted during processing.

func (*AggregationCountResponseDto) GetAggregations added in v1.1.0

func (a *AggregationCountResponseDto) GetAggregations() *Aggregations

func (*AggregationCountResponseDto) GetExtraProperties added in v1.1.0

func (a *AggregationCountResponseDto) GetExtraProperties() map[string]interface{}

func (*AggregationCountResponseDto) GetPage added in v1.1.0

func (a *AggregationCountResponseDto) GetPage() int

func (*AggregationCountResponseDto) GetPageSize added in v1.1.0

func (a *AggregationCountResponseDto) GetPageSize() int

func (*AggregationCountResponseDto) GetStatus added in v1.1.0

func (a *AggregationCountResponseDto) GetStatus() string

func (*AggregationCountResponseDto) GetTotalHits added in v1.1.0

func (a *AggregationCountResponseDto) GetTotalHits() int

func (*AggregationCountResponseDto) GetTotalPages added in v1.1.0

func (a *AggregationCountResponseDto) GetTotalPages() int

func (*AggregationCountResponseDto) GetUserInput added in v1.1.0

func (a *AggregationCountResponseDto) GetUserInput() *UserInputDto

func (*AggregationCountResponseDto) String added in v1.1.0

func (a *AggregationCountResponseDto) String() string

func (*AggregationCountResponseDto) UnmarshalJSON added in v1.1.0

func (a *AggregationCountResponseDto) UnmarshalJSON(data []byte) error

type AggregationGetRequest added in v1.1.0

type AggregationGetRequest struct {
	// The keyword(s) to search for in articles. Query syntax supports logical operators (`AND`, `OR`, `NOT`) and wildcards:
	//
	//   - For an exact match, use double quotes. For example, `"technology news"`.
	//   - Use `*` to search for any keyword.
	//   - Use `+` to include and `-` to exclude specific words or phrases.
	//     For example, `+Apple`, `-Google`.
	//   - Use `AND`, `OR`, and `NOT` to refine search results.
	//     For example, `technology AND (Apple OR Microsoft) NOT Google`.
	//
	// For more details, see [Advanced querying](/docs/v3/documentation/guides-and-concepts/advanced-querying).
	Q string `json:"-" url:"q"`
	// The article fields to search in. To search in multiple fields, use a comma-separated string.
	//
	// Example: `"title, summary"`
	//
	// **Note**: The `summary` option is available if NLP is enabled in your plan.
	//
	// Available options: `title`, `summary`, `content`.
	SearchIn *string `json:"-" url:"search_in,omitempty"`
	// Predefined top news sources per country.
	//
	// Format: start with the word `top`, followed by the number of desired sources, and then the two-letter country code [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Multiple countries with the number of top sources can be specified as a comma-separated string.
	//
	// Examples:
	// - `"top 100 US"`
	// - `"top 33 AT"`
	// - `"top 50 US, top 20 GB"`
	// - `"top 33 AT, top 50 IT"`
	PredefinedSources *string `json:"-" url:"predefined_sources,omitempty"`
	// One or more news sources to narrow down the search. The format must be a domain URL. Subdomains, such as `finance.yahoo.com`, are also acceptable.To specify multiple sources, use a comma-separated string.
	//
	// Examples:
	// - `"nytimes.com"`
	// - `"theguardian.com, finance.yahoo.com"`
	Sources *string `json:"-" url:"sources,omitempty"`
	// The news sources to exclude from the search. To exclude multiple sources, use a comma-separated string.
	//
	// Example: `"cnn.com, wsj.com"`
	NotSources *string `json:"-" url:"not_sources,omitempty"`
	// The language(s) of the search. The only accepted format is the two-letter [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) code. To select multiple languages, use a comma-separated string.
	//
	// Example: `"en, es"`
	//
	// To learn more, see [Enumerated parameters > Language](/docs/v3/api-reference/overview/enumerated-parameters#language-lang-and-not-lang).
	Lang *string `json:"-" url:"lang,omitempty"`
	// The language(s) to exclude from the search. The accepted format is the two-letter [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) code. To exclude multiple languages, use a comma-separated string.
	//
	// Example: `"fr, de"`
	//
	// To learn more, see [Enumerated parameters > Language](/docs/v3/api-reference/overview/enumerated-parameters#language-lang-and-not-lang).
	NotLang *string `json:"-" url:"not_lang,omitempty"`
	// The countries where the news publisher is located. The accepted format is the two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. To select multiple countries, use a comma-separated string.
	//
	// Example: `"US, CA"`
	//
	// To learn more, see [Enumerated parameters > Country](/docs/v3/api-reference/overview/enumerated-parameters#country-country-and-not-country).
	Countries *string `json:"-" url:"countries,omitempty"`
	// The publisher location countries to exclude from the search. The accepted format is the two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. To exclude multiple countries, use a comma-separated string.
	//
	// Example:`"US, CA"`
	//
	// To learn more, see [Enumerated parameters > Country](/docs/v3/api-reference/overview/enumerated-parameters#country-country-and-not-country).
	NotCountries *string `json:"-" url:"not_countries,omitempty"`
	// The list of author names to exclude from your search. To exclude articles by specific authors, use a comma-separated string.
	//
	// Example: `"John Doe, Jane Doe"`
	NotAuthorName *string `json:"-" url:"not_author_name,omitempty"`
	// The starting point in time to search from. Accepts date-time strings in ISO 8601 format and plain text. The default time zone is UTC.
	//
	// Formats with examples:
	// - YYYY-mm-ddTHH:MM:SS: `2024-07-01T00:00:00`
	// - YYYY-MM-dd: `2024-07-01`
	// - YYYY/mm/dd HH:MM:SS: `2024/07/01 00:00:00`
	// - YYYY/mm/dd: `2024/07/01`
	// - English phrases: `1 day ago`, `today`
	//
	// **Note**: By default, applied to the publication date of the article. To use the article's parse date instead, set the `by_parse_date` parameter to `true`.
	From *time.Time `json:"-" url:"from_,omitempty"`
	// The ending point in time to search up to. Accepts date-time strings in ISO 8601 format and plain text. The default time zone is UTC.
	//
	// Formats with examples:
	// - YYYY-mm-ddTHH:MM:SS: `2024-07-01T00:00:00`
	// - YYYY-MM-dd: `2024-07-01`
	// - YYYY/mm/dd HH:MM:SS: `2024/07/01 00:00:00`
	// - YYYY/mm/dd: `2024/07/01`
	// - English phrases: `1 day ago`, `today`
	//
	// **Note**: By default, applied to the publication date of the article. To use the article's parse date instead, set the `by_parse_date` parameter to `true`.
	To *time.Time `json:"-" url:"to_,omitempty"`
	// The precision of the published date. There are three types:
	// - `full`: The day and time of an article is correctly identified with the appropriate timezone.
	// - `timezone unknown`: The day and time of an article is correctly identified without timezone.
	// - `date`: Only the day is identified without an exact time.
	PublishedDatePrecision *AggregationGetRequestPublishedDatePrecision `json:"-" url:"published_date_precision,omitempty"`
	// If true, the `from_` and `to_` parameters use article parse dates instead of published dates. Additionally, the `parse_date` variable is added to the output for each article object.
	ByParseDate *bool `json:"-" url:"by_parse_date,omitempty"`
	// The sorting order of the results. Possible values are:
	// - `relevancy`: The most relevant results first.
	// - `date`: The most recently published results first.
	// - `rank`: The results from the highest-ranked sources first.
	SortBy *AggregationGetRequestSortBy `json:"-" url:"sort_by,omitempty"`
	// If true, limits the search to sources ranked in the top 1 million online websites. If false, includes unranked sources which are assigned a rank of 999999.
	RankedOnly *bool `json:"-" url:"ranked_only,omitempty"`
	// The lowest boundary of the rank of a news website to filter by. A lower rank indicates a more popular source.
	FromRank *int `json:"-" url:"from_rank,omitempty"`
	// The highest boundary of the rank of a news website to filter by. A lower rank indicates a more popular source.
	ToRank *int `json:"-" url:"to_rank,omitempty"`
	// If true, only returns articles that were posted on the home page of a given news domain.
	IsHeadline *bool `json:"-" url:"is_headline,omitempty"`
	// If true, returns only opinion pieces. If false, excludes opinion-based articles and returns news only.
	IsOpinion *bool `json:"-" url:"is_opinion,omitempty"`
	// If false, returns only articles that have publicly available complete content. Some publishers partially block content, so this setting ensures that only full articles are retrieved.
	IsPaidContent *bool `json:"-" url:"is_paid_content,omitempty"`
	// The categorical URL(s) to filter your search. To filter your search by multiple categorical URLs, use a comma-separated string.
	//
	// Example: `"wsj.com/politics, wsj.com/tech"`
	ParentUrl *string `json:"-" url:"parent_url,omitempty"`
	// The complete URL(s) mentioned in the article. For multiple URLs, use a comma-separated string.
	//
	// Example: `"https://aiindex.stanford.edu/report, https://www.stateof.ai"`
	//
	// For more details, see [Search by URL](/docs/v3/documentation/how-to/search-by-url).
	AllLinks *string `json:"-" url:"all_links,omitempty"`
	// The domain(s) mentioned in the article. For multiple domains, use a comma-separated string.
	//
	// Example: `"who.int, nih.gov"`
	//
	// For more details, see [Search by URL](/docs/v3/documentation/how-to/search-by-url).
	AllDomainLinks *string `json:"-" url:"all_domain_links,omitempty"`
	// The minimum number of words an article must contain. To be used for avoiding articles with small content.
	WordCountMin *int `json:"-" url:"word_count_min,omitempty"`
	// The maximum number of words an article can contain. To be used for avoiding articles with large content.
	WordCountMax *int `json:"-" url:"word_count_max,omitempty"`
	// The page number to scroll through the results. Use for pagination, as a single API response can return up to 1,000 articles.
	//
	// For details, see [How to paginate large datasets](https://www.newscatcherapi.com/docs/v3/documentation/how-to/paginate-large-datasets).
	Page *int `json:"-" url:"page,omitempty"`
	// The number of articles to return per page.
	PageSize *int `json:"-" url:"page_size,omitempty"`
	// If true, includes an NLP layer with each article in the response. This layer provides enhanced information such as theme classification, article summary, sentiment analysis, tags, and named entity recognition.
	//
	// The NLP layer includes:
	// - Theme: General topic of the article.
	// - Summary: A concise overview of the article content.
	// - Sentiment: Separate scores for title and content (range: -1 to 1).
	// - Named entities: Identified persons (PER), organizations (ORG), locations (LOC), and miscellaneous entities (MISC).
	// - IPTC tags: Standardized news category tags.
	// - IAB tags: Content categories for digital advertising.
	//
	// **Note**: The `include_nlp_data` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	IncludeNlpData *bool `json:"-" url:"include_nlp_data,omitempty"`
	// If true, filters the results to include only articles with an NLP layer. This allows you to focus on articles that have been processed with advanced NLP techniques.
	//
	// **Note**: The `has_nlp` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	HasNlp *bool `json:"-" url:"has_nlp,omitempty"`
	// Filters articles based on their general topic, as determined by NLP analysis. To select multiple themes, use a comma-separated string.
	//
	// Example: `"Finance, Tech"`
	//
	// **Note**: The `theme` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	//
	// Available options: `Business`, `Economics`, `Entertainment`, `Finance`, `Health`, `Politics`, `Science`, `Sports`, `Tech`, `Crime`, `Financial Crime`, `Lifestyle`, `Automotive`, `Travel`, `Weather`, `General`.
	Theme *string `json:"-" url:"theme,omitempty"`
	// Inverse of the `theme` parameter. Excludes articles based on their general topic, as determined by NLP analysis. To exclude multiple themes, use a comma-separated string.
	//
	// Example: `"Crime, Tech"`
	//
	// **Note**: The `not_theme` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	NotTheme *string `json:"-" url:"not_theme,omitempty"`
	// Filters articles that mention specific organization names, as identified by NLP analysis. To specify multiple organizations, use a comma-separated string.
	//
	// Example: `"Apple, Microsoft"`
	//
	// **Note**: The `ORG_entity_name` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [Search by entity](/docs/v3/documentation/how-to/search-by-entity).
	OrgEntityName *string `json:"-" url:"ORG_entity_name,omitempty"`
	// Filters articles that mention specific person names, as identified by NLP analysis. To specify multiple names, use a comma-separated string.
	//
	// Example: `"Elon Musk, Jeff Bezos"`
	//
	// **Note**: The `PER_entity_name` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [Search by entity](/docs/v3/documentation/how-to/search-by-entity).
	PerEntityName *string `json:"-" url:"PER_entity_name,omitempty"`
	// Filters articles that mention specific location names, as identified by NLP analysis. To specify multiple locations, use a comma-separated string.
	//
	// Example: `"California, New York"`
	//
	// **Note**: The `LOC_entity_name` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [Search by entity](/docs/v3/documentation/how-to/search-by-entity).
	LocEntityName *string `json:"-" url:"LOC_entity_name,omitempty"`
	// Filters articles that mention other named entities not falling under person, organization, or location categories. Includes events, nationalities, products, works of art, and more. To specify multiple entities, use a comma-separated string.
	//
	// Example: `"Bitcoin, Blockchain"`
	//
	// **Note**: The `MISC_entity_name` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [Search by entity](/docs/v3/documentation/how-to/search-by-entity).
	MiscEntityName *string `json:"-" url:"MISC_entity_name,omitempty"`
	// Filters articles based on the minimum sentiment score of their titles.
	//
	// Range is `-1.0` to `1.0`, where:
	// - Negative values indicate negative sentiment.
	// - Positive values indicate positive sentiment.
	// - Values close to 0 indicate neutral sentiment.
	//
	// **Note**: The `title_sentiment_min` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	TitleSentimentMin *float64 `json:"-" url:"title_sentiment_min,omitempty"`
	// Filters articles based on the maximum sentiment score of their titles.
	//
	// Range is `-1.0` to `1.0`, where:
	// - Negative values indicate negative sentiment.
	// - Positive values indicate positive sentiment.
	// - Values close to 0 indicate neutral sentiment.
	//
	// **Note**: The `title_sentiment_max` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	TitleSentimentMax *float64 `json:"-" url:"title_sentiment_max,omitempty"`
	// Filters articles based on the minimum sentiment score of their content.
	//
	// Range is `-1.0` to `1.0`, where:
	// - Negative values indicate negative sentiment.
	// - Positive values indicate positive sentiment.
	// - Values close to 0 indicate neutral sentiment.
	//
	// **Note**: The `content_sentiment_min` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	ContentSentimentMin *float64 `json:"-" url:"content_sentiment_min,omitempty"`
	// Filters articles based on the maximum sentiment score of their content.
	//
	// Range is `-1.0` to `1.0`, where:
	// - Negative values indicate negative sentiment.
	// - Positive values indicate positive sentiment.
	// - Values close to 0 indicate neutral sentiment.
	//
	// **Note**: The `content_sentiment_max` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	ContentSentimentMax *float64 `json:"-" url:"content_sentiment_max,omitempty"`
	// Filters articles based on International Press Telecommunications Council (IPTC) media topic tags. To specify multiple IPTC tags, use a comma-separated string of tag IDs.
	//
	// Example: `"20000199, 20000209"`
	//
	// **Note**: The `iptc_tags` parameter is only available if tags are included in your subscription plan.
	//
	// To learn more, see [IPTC Media Topic NewsCodes](https://www.iptc.org/std/NewsCodes/treeview/mediatopic/mediatopic-en-GB.html).
	IptcTags *string `json:"-" url:"iptc_tags,omitempty"`
	// Inverse of the `iptc_tags` parameter. Excludes articles based on International Press Telecommunications Council (IPTC) media topic tags. To specify multiple IPTC tags to exclude, use a comma-separated string of tag IDs.
	//
	// Example: `"20000205, 20000209"`
	//
	// **Note**: The `not_iptc_tags` parameter is only available if tags are included in your subscription plan.
	//
	// To learn more, see [IPTC Media Topic NewsCodes](https://www.iptc.org/std/NewsCodes/treeview/mediatopic/mediatopic-en-GB.html).
	NotIptcTags *string `json:"-" url:"not_iptc_tags,omitempty"`
	// The aggregation interval for the results. Possible values are:
	// - `day`: Aggregates results by day.
	// - `hour`: Aggregates results by hour.
	AggregationBy *AggregationGetRequestAggregationBy `json:"-" url:"aggregation_by,omitempty"`
}

type AggregationGetRequestAggregationBy added in v1.1.0

type AggregationGetRequestAggregationBy string
const (
	AggregationGetRequestAggregationByDay  AggregationGetRequestAggregationBy = "day"
	AggregationGetRequestAggregationByHour AggregationGetRequestAggregationBy = "hour"
)

func NewAggregationGetRequestAggregationByFromString added in v1.1.0

func NewAggregationGetRequestAggregationByFromString(s string) (AggregationGetRequestAggregationBy, error)

func (AggregationGetRequestAggregationBy) Ptr added in v1.1.0

type AggregationGetRequestPublishedDatePrecision added in v1.1.0

type AggregationGetRequestPublishedDatePrecision string
const (
	AggregationGetRequestPublishedDatePrecisionFull            AggregationGetRequestPublishedDatePrecision = "full"
	AggregationGetRequestPublishedDatePrecisionTimezoneUnknown AggregationGetRequestPublishedDatePrecision = "timezone unknown"
	AggregationGetRequestPublishedDatePrecisionDate            AggregationGetRequestPublishedDatePrecision = "date"
)

func NewAggregationGetRequestPublishedDatePrecisionFromString added in v1.1.0

func NewAggregationGetRequestPublishedDatePrecisionFromString(s string) (AggregationGetRequestPublishedDatePrecision, error)

func (AggregationGetRequestPublishedDatePrecision) Ptr added in v1.1.0

type AggregationGetRequestSortBy added in v1.1.0

type AggregationGetRequestSortBy string
const (
	AggregationGetRequestSortByRelevancy AggregationGetRequestSortBy = "relevancy"
	AggregationGetRequestSortByDate      AggregationGetRequestSortBy = "date"
	AggregationGetRequestSortByRank      AggregationGetRequestSortBy = "rank"
)

func NewAggregationGetRequestSortByFromString added in v1.1.0

func NewAggregationGetRequestSortByFromString(s string) (AggregationGetRequestSortBy, error)

func (AggregationGetRequestSortBy) Ptr added in v1.1.0

type AggregationGetResponse added in v1.1.0

type AggregationGetResponse struct {
	AggregationCountResponseDto       *AggregationCountResponseDto
	FailedAggregationCountResponseDto *FailedAggregationCountResponseDto
	// contains filtered or unexported fields
}

func NewAggregationGetResponseFromAggregationCountResponseDto added in v1.1.0

func NewAggregationGetResponseFromAggregationCountResponseDto(value *AggregationCountResponseDto) *AggregationGetResponse

func NewAggregationGetResponseFromFailedAggregationCountResponseDto added in v1.1.0

func NewAggregationGetResponseFromFailedAggregationCountResponseDto(value *FailedAggregationCountResponseDto) *AggregationGetResponse

func (*AggregationGetResponse) Accept added in v1.1.0

func (*AggregationGetResponse) GetAggregationCountResponseDto added in v1.1.0

func (a *AggregationGetResponse) GetAggregationCountResponseDto() *AggregationCountResponseDto

func (*AggregationGetResponse) GetFailedAggregationCountResponseDto added in v1.1.0

func (a *AggregationGetResponse) GetFailedAggregationCountResponseDto() *FailedAggregationCountResponseDto

func (AggregationGetResponse) MarshalJSON added in v1.1.0

func (a AggregationGetResponse) MarshalJSON() ([]byte, error)

func (*AggregationGetResponse) UnmarshalJSON added in v1.1.0

func (a *AggregationGetResponse) UnmarshalJSON(data []byte) error

type AggregationGetResponseVisitor added in v1.1.0

type AggregationGetResponseVisitor interface {
	VisitAggregationCountResponseDto(*AggregationCountResponseDto) error
	VisitFailedAggregationCountResponseDto(*FailedAggregationCountResponseDto) error
}

type AggregationItem added in v1.1.0

type AggregationItem struct {
	// Array of time frames and their corresponding article counts
	AggregationCount []*TimeFrameCount `json:"aggregation_count,omitempty" url:"aggregation_count,omitempty"`
	// contains filtered or unexported fields
}

A single item in the aggregations array containing a collection of time-based article counts.

func (*AggregationItem) GetAggregationCount added in v1.1.0

func (a *AggregationItem) GetAggregationCount() []*TimeFrameCount

func (*AggregationItem) GetExtraProperties added in v1.1.0

func (a *AggregationItem) GetExtraProperties() map[string]interface{}

func (*AggregationItem) String added in v1.1.0

func (a *AggregationItem) String() string

func (*AggregationItem) UnmarshalJSON added in v1.1.0

func (a *AggregationItem) UnmarshalJSON(data []byte) error

type AggregationPostRequest added in v1.1.0

type AggregationPostRequest struct {
	Q                      Q                       `json:"q" url:"-"`
	SearchIn               *SearchIn               `json:"search_in,omitempty" url:"-"`
	PredefinedSources      *PredefinedSources      `json:"predefined_sources,omitempty" url:"-"`
	Sources                *Sources                `json:"sources,omitempty" url:"-"`
	NotSources             *NotSources             `json:"not_sources,omitempty" url:"-"`
	Lang                   *Lang                   `json:"lang,omitempty" url:"-"`
	NotLang                *NotLang                `json:"not_lang,omitempty" url:"-"`
	Countries              *Countries              `json:"countries,omitempty" url:"-"`
	NotCountries           *NotCountries           `json:"not_countries,omitempty" url:"-"`
	NotAuthorName          *NotAuthorName          `json:"not_author_name,omitempty" url:"-"`
	From                   *From                   `json:"from_,omitempty" url:"-"`
	To                     *To                     `json:"to_,omitempty" url:"-"`
	PublishedDatePrecision *PublishedDatePrecision `json:"published_date_precision,omitempty" url:"-"`
	ByParseDate            *ByParseDate            `json:"by_parse_date,omitempty" url:"-"`
	SortBy                 *SortBy                 `json:"sort_by,omitempty" url:"-"`
	RankedOnly             *RankedOnly             `json:"ranked_only,omitempty" url:"-"`
	FromRank               *FromRank               `json:"from_rank,omitempty" url:"-"`
	ToRank                 *ToRank                 `json:"to_rank,omitempty" url:"-"`
	IsHeadline             *IsHeadline             `json:"is_headline,omitempty" url:"-"`
	IsOpinion              *IsOpinion              `json:"is_opinion,omitempty" url:"-"`
	IsPaidContent          *IsPaidContent          `json:"is_paid_content,omitempty" url:"-"`
	ParentUrl              *ParentUrl              `json:"parent_url,omitempty" url:"-"`
	AllLinks               *AllLinks               `json:"all_links,omitempty" url:"-"`
	AllDomainLinks         *AllDomainLinks         `json:"all_domain_links,omitempty" url:"-"`
	WordCountMin           *WordCountMin           `json:"word_count_min,omitempty" url:"-"`
	WordCountMax           *WordCountMax           `json:"word_count_max,omitempty" url:"-"`
	Page                   *Page                   `json:"page,omitempty" url:"-"`
	PageSize               *PageSize               `json:"page_size,omitempty" url:"-"`
	IncludeNlpData         *IncludeNlpData         `json:"include_nlp_data,omitempty" url:"-"`
	HasNlp                 *HasNlp                 `json:"has_nlp,omitempty" url:"-"`
	Theme                  *Theme                  `json:"theme,omitempty" url:"-"`
	NotTheme               *NotTheme               `json:"not_theme,omitempty" url:"-"`
	OrgEntityName          *OrgEntityName          `json:"ORG_entity_name,omitempty" url:"-"`
	PerEntityName          *PerEntityName          `json:"PER_entity_name,omitempty" url:"-"`
	LocEntityName          *LocEntityName          `json:"LOC_entity_name,omitempty" url:"-"`
	MiscEntityName         *MiscEntityName         `json:"MISC_entity_name,omitempty" url:"-"`
	TitleSentimentMin      *TitleSentimentMin      `json:"title_sentiment_min,omitempty" url:"-"`
	TitleSentimentMax      *TitleSentimentMax      `json:"title_sentiment_max,omitempty" url:"-"`
	ContentSentimentMin    *ContentSentimentMin    `json:"content_sentiment_min,omitempty" url:"-"`
	ContentSentientMax     *ContentSentimentMax    `json:"content_sentient_max,omitempty" url:"-"`
	IptcTags               *IptcTags               `json:"iptc_tags,omitempty" url:"-"`
	NotIptcTags            *NotIptcTags            `json:"not_iptc_tags,omitempty" url:"-"`
	AggregationBy          *AggregationBy          `json:"aggregation_by,omitempty" url:"-"`
}

type AggregationPostResponse added in v1.1.0

type AggregationPostResponse struct {
	AggregationCountResponseDto       *AggregationCountResponseDto
	FailedAggregationCountResponseDto *FailedAggregationCountResponseDto
	// contains filtered or unexported fields
}

func NewAggregationPostResponseFromAggregationCountResponseDto added in v1.1.0

func NewAggregationPostResponseFromAggregationCountResponseDto(value *AggregationCountResponseDto) *AggregationPostResponse

func NewAggregationPostResponseFromFailedAggregationCountResponseDto added in v1.1.0

func NewAggregationPostResponseFromFailedAggregationCountResponseDto(value *FailedAggregationCountResponseDto) *AggregationPostResponse

func (*AggregationPostResponse) Accept added in v1.1.0

func (*AggregationPostResponse) GetAggregationCountResponseDto added in v1.1.0

func (a *AggregationPostResponse) GetAggregationCountResponseDto() *AggregationCountResponseDto

func (*AggregationPostResponse) GetFailedAggregationCountResponseDto added in v1.1.0

func (a *AggregationPostResponse) GetFailedAggregationCountResponseDto() *FailedAggregationCountResponseDto

func (AggregationPostResponse) MarshalJSON added in v1.1.0

func (a AggregationPostResponse) MarshalJSON() ([]byte, error)

func (*AggregationPostResponse) UnmarshalJSON added in v1.1.0

func (a *AggregationPostResponse) UnmarshalJSON(data []byte) error

type AggregationPostResponseVisitor added in v1.1.0

type AggregationPostResponseVisitor interface {
	VisitAggregationCountResponseDto(*AggregationCountResponseDto) error
	VisitFailedAggregationCountResponseDto(*FailedAggregationCountResponseDto) error
}

type Aggregations added in v1.1.0

type Aggregations struct {
	AggregationItem     *AggregationItem
	AggregationItemList []*AggregationItem
	// contains filtered or unexported fields
}

The aggregation results. Can be either a dictionary or a list of dictionaries.

func NewAggregationsFromAggregationItem added in v1.1.0

func NewAggregationsFromAggregationItem(value *AggregationItem) *Aggregations

func NewAggregationsFromAggregationItemList added in v1.1.0

func NewAggregationsFromAggregationItemList(value []*AggregationItem) *Aggregations

func (*Aggregations) Accept added in v1.1.0

func (a *Aggregations) Accept(visitor AggregationsVisitor) error

func (*Aggregations) GetAggregationItem added in v1.1.0

func (a *Aggregations) GetAggregationItem() *AggregationItem

func (*Aggregations) GetAggregationItemList added in v1.1.0

func (a *Aggregations) GetAggregationItemList() []*AggregationItem

func (Aggregations) MarshalJSON added in v1.1.0

func (a Aggregations) MarshalJSON() ([]byte, error)

func (*Aggregations) UnmarshalJSON added in v1.1.0

func (a *Aggregations) UnmarshalJSON(data []byte) error

type AggregationsVisitor added in v1.1.0

type AggregationsVisitor interface {
	VisitAggregationItem(*AggregationItem) error
	VisitAggregationItemList([]*AggregationItem) error
}
type AllDomainLinks struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

The domain(s) mentioned in the article. For multiple domains, use a comma-separated string or an array of strings.

Examples: - `"who.int, nih.gov"` - `["who.int", "nih.gov"]`

For more details, see [Search by URL](/docs/v3/documentation/how-to/search-by-url).

func NewAllDomainLinksFromString added in v1.1.0

func NewAllDomainLinksFromString(value string) *AllDomainLinks

func NewAllDomainLinksFromStringList added in v1.1.0

func NewAllDomainLinksFromStringList(value []string) *AllDomainLinks

func (*AllDomainLinks) Accept added in v1.1.0

func (a *AllDomainLinks) Accept(visitor AllDomainLinksVisitor) error

func (*AllDomainLinks) GetString added in v1.1.0

func (a *AllDomainLinks) GetString() string

func (*AllDomainLinks) GetStringList added in v1.1.0

func (a *AllDomainLinks) GetStringList() []string

func (AllDomainLinks) MarshalJSON added in v1.1.0

func (a AllDomainLinks) MarshalJSON() ([]byte, error)

func (*AllDomainLinks) UnmarshalJSON added in v1.1.0

func (a *AllDomainLinks) UnmarshalJSON(data []byte) error

type AllDomainLinksVisitor added in v1.1.0

type AllDomainLinksVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}
type AllLinks struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

The complete URL(s) mentioned in the article. For multiple URLs, use a comma-separated string or an array of strings.

Examples: - `"https://aiindex.stanford.edu/report/, https://www.stateof.ai/"` - `["https://aiindex.stanford.edu/report/", "https://www.stateof.ai/"]`

For more details, see [Search by URL](/docs/v3/documentation/how-to/search-by-url).

func NewAllLinksFromString added in v1.1.0

func NewAllLinksFromString(value string) *AllLinks

func NewAllLinksFromStringList added in v1.1.0

func NewAllLinksFromStringList(value []string) *AllLinks

func (*AllLinks) Accept added in v1.1.0

func (a *AllLinks) Accept(visitor AllLinksVisitor) error

func (*AllLinks) GetString added in v1.1.0

func (a *AllLinks) GetString() string

func (*AllLinks) GetStringList added in v1.1.0

func (a *AllLinks) GetStringList() []string

func (AllLinks) MarshalJSON added in v1.1.0

func (a AllLinks) MarshalJSON() ([]byte, error)

func (*AllLinks) UnmarshalJSON added in v1.1.0

func (a *AllLinks) UnmarshalJSON(data []byte) error

type AllLinksVisitor added in v1.1.0

type AllLinksVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}

type ArticleEntity added in v1.1.0

type ArticleEntity struct {
	// The title of the article.
	Title string `json:"title" url:"title"`
	// The primary author of the article.
	Author *string `json:"author,omitempty" url:"author,omitempty"`
	// A list of authors of the article.
	Authors *Authors `json:"authors,omitempty" url:"authors,omitempty"`
	// A list of journalists associated with the article.
	Journalists *Journalists `json:"journalists,omitempty" url:"journalists,omitempty"`
	// The date the article was published.
	PublishedDate *string `json:"published_date,omitempty" url:"published_date,omitempty"`
	// The precision of the published date.
	PublishedDatePrecision *string `json:"published_date_precision,omitempty" url:"published_date_precision,omitempty"`
	// The date the article was last updated.
	UpdatedDate *string `json:"updated_date,omitempty" url:"updated_date,omitempty"`
	// The precision of the updated date.
	UpdatedDatePrecision *string `json:"updated_date_precision,omitempty" url:"updated_date_precision,omitempty"`
	// The date the article was parsed.
	ParseDate *string `json:"parse_date,omitempty" url:"parse_date,omitempty"`
	// The URL link to the article.
	Link string `json:"link" url:"link"`
	// The domain URL of the article.
	DomainUrl string `json:"domain_url" url:"domain_url"`
	// The full domain URL of the article.
	FullDomainUrl string `json:"full_domain_url" url:"full_domain_url"`
	// The name of the source where the article was published.
	NameSource *string `json:"name_source,omitempty" url:"name_source,omitempty"`
	// Indicates if the article is a headline.
	IsHeadline *bool `json:"is_headline,omitempty" url:"is_headline,omitempty"`
	// Indicates if the article is paid content.
	PaidContent *bool `json:"paid_content,omitempty" url:"paid_content,omitempty"`
	// The categorical URL of the article.
	ParentUrl string `json:"parent_url" url:"parent_url"`
	// The country where the article was published.
	Country *string `json:"country,omitempty" url:"country,omitempty"`
	// The rights information for the article.
	Rights *string `json:"rights,omitempty" url:"rights,omitempty"`
	// The rank of the article's source.
	Rank int `json:"rank" url:"rank"`
	// The media associated with the article.
	Media *string `json:"media,omitempty" url:"media,omitempty"`
	// The language in which the article is written.
	Language *string `json:"language,omitempty" url:"language,omitempty"`
	// A brief description of the article.
	Description *string `json:"description,omitempty" url:"description,omitempty"`
	// The content of the article.
	Content string `json:"content" url:"content"`
	// The word count of the article.
	WordCount *int `json:"word_count,omitempty" url:"word_count,omitempty"`
	// Indicates if the article is an opinion piece.
	IsOpinion *bool `json:"is_opinion,omitempty" url:"is_opinion,omitempty"`
	// The Twitter account associated with the article.
	TwitterAccount *string `json:"twitter_account,omitempty" url:"twitter_account,omitempty"`
	// A list of all URLs mentioned in the article.
	AllLinks *ArticleEntityAllLinks `json:"all_links,omitempty" url:"all_links,omitempty"`
	// A list of all domain URLs mentioned in the article.
	AllDomainLinks *ArticleEntityAllDomainLinks `json:"all_domain_links,omitempty" url:"all_domain_links,omitempty"`
	Nlp            *NlpDataEntity               `json:"nlp,omitempty" url:"nlp,omitempty"`
	// The unique identifier for the article.
	Id string `json:"id" url:"id"`
	// The relevance score of the article.
	Score float64 `json:"score" url:"score"`
	// An object that contains custom tags associated with an article, where each key is a taxonomy name, and the value is an array of tags.
	CustomTags           map[string][]string         `json:"custom_tags,omitempty" url:"custom_tags,omitempty"`
	AdditionalDomainInfo *AdditionalDomainInfoEntity `json:"additional_domain_info,omitempty" url:"additional_domain_info,omitempty"`
	// contains filtered or unexported fields
}

The data model representing a single article in the search results.

func (*ArticleEntity) GetAdditionalDomainInfo added in v1.1.0

func (a *ArticleEntity) GetAdditionalDomainInfo() *AdditionalDomainInfoEntity
func (a *ArticleEntity) GetAllDomainLinks() *ArticleEntityAllDomainLinks
func (a *ArticleEntity) GetAllLinks() *ArticleEntityAllLinks

func (*ArticleEntity) GetAuthor added in v1.1.0

func (a *ArticleEntity) GetAuthor() *string

func (*ArticleEntity) GetAuthors added in v1.1.0

func (a *ArticleEntity) GetAuthors() *Authors

func (*ArticleEntity) GetContent added in v1.1.0

func (a *ArticleEntity) GetContent() string

func (*ArticleEntity) GetCountry added in v1.1.0

func (a *ArticleEntity) GetCountry() *string

func (*ArticleEntity) GetCustomTags added in v1.1.0

func (a *ArticleEntity) GetCustomTags() map[string][]string

func (*ArticleEntity) GetDescription added in v1.1.0

func (a *ArticleEntity) GetDescription() *string

func (*ArticleEntity) GetDomainUrl added in v1.1.0

func (a *ArticleEntity) GetDomainUrl() string

func (*ArticleEntity) GetExtraProperties added in v1.1.0

func (a *ArticleEntity) GetExtraProperties() map[string]interface{}

func (*ArticleEntity) GetFullDomainUrl added in v1.1.0

func (a *ArticleEntity) GetFullDomainUrl() string

func (*ArticleEntity) GetId added in v1.1.0

func (a *ArticleEntity) GetId() string

func (*ArticleEntity) GetIsHeadline added in v1.1.0

func (a *ArticleEntity) GetIsHeadline() *bool

func (*ArticleEntity) GetIsOpinion added in v1.1.0

func (a *ArticleEntity) GetIsOpinion() *bool

func (*ArticleEntity) GetJournalists added in v1.1.0

func (a *ArticleEntity) GetJournalists() *Journalists

func (*ArticleEntity) GetLanguage added in v1.1.0

func (a *ArticleEntity) GetLanguage() *string
func (a *ArticleEntity) GetLink() string

func (*ArticleEntity) GetMedia added in v1.1.0

func (a *ArticleEntity) GetMedia() *string

func (*ArticleEntity) GetNameSource added in v1.1.0

func (a *ArticleEntity) GetNameSource() *string

func (*ArticleEntity) GetNlp added in v1.1.0

func (a *ArticleEntity) GetNlp() *NlpDataEntity

func (*ArticleEntity) GetPaidContent added in v1.1.0

func (a *ArticleEntity) GetPaidContent() *bool

func (*ArticleEntity) GetParentUrl added in v1.1.0

func (a *ArticleEntity) GetParentUrl() string

func (*ArticleEntity) GetParseDate added in v1.1.0

func (a *ArticleEntity) GetParseDate() *string

func (*ArticleEntity) GetPublishedDate added in v1.1.0

func (a *ArticleEntity) GetPublishedDate() *string

func (*ArticleEntity) GetPublishedDatePrecision added in v1.1.0

func (a *ArticleEntity) GetPublishedDatePrecision() *string

func (*ArticleEntity) GetRank added in v1.1.0

func (a *ArticleEntity) GetRank() int

func (*ArticleEntity) GetRights added in v1.1.0

func (a *ArticleEntity) GetRights() *string

func (*ArticleEntity) GetScore added in v1.1.0

func (a *ArticleEntity) GetScore() float64

func (*ArticleEntity) GetTitle added in v1.1.0

func (a *ArticleEntity) GetTitle() string

func (*ArticleEntity) GetTwitterAccount added in v1.1.0

func (a *ArticleEntity) GetTwitterAccount() *string

func (*ArticleEntity) GetUpdatedDate added in v1.1.0

func (a *ArticleEntity) GetUpdatedDate() *string

func (*ArticleEntity) GetUpdatedDatePrecision added in v1.1.0

func (a *ArticleEntity) GetUpdatedDatePrecision() *string

func (*ArticleEntity) GetWordCount added in v1.1.0

func (a *ArticleEntity) GetWordCount() *int

func (*ArticleEntity) String added in v1.1.0

func (a *ArticleEntity) String() string

func (*ArticleEntity) UnmarshalJSON added in v1.1.0

func (a *ArticleEntity) UnmarshalJSON(data []byte) error
type ArticleEntityAllDomainLinks struct {
	StringList []string
	String     string
	// contains filtered or unexported fields
}

A list of all domain URLs mentioned in the article.

func NewArticleEntityAllDomainLinksFromString added in v1.1.0

func NewArticleEntityAllDomainLinksFromString(value string) *ArticleEntityAllDomainLinks

func NewArticleEntityAllDomainLinksFromStringList added in v1.1.0

func NewArticleEntityAllDomainLinksFromStringList(value []string) *ArticleEntityAllDomainLinks

func (*ArticleEntityAllDomainLinks) Accept added in v1.1.0

func (*ArticleEntityAllDomainLinks) GetString added in v1.1.0

func (a *ArticleEntityAllDomainLinks) GetString() string

func (*ArticleEntityAllDomainLinks) GetStringList added in v1.1.0

func (a *ArticleEntityAllDomainLinks) GetStringList() []string

func (ArticleEntityAllDomainLinks) MarshalJSON added in v1.1.0

func (a ArticleEntityAllDomainLinks) MarshalJSON() ([]byte, error)

func (*ArticleEntityAllDomainLinks) UnmarshalJSON added in v1.1.0

func (a *ArticleEntityAllDomainLinks) UnmarshalJSON(data []byte) error

type ArticleEntityAllDomainLinksVisitor added in v1.1.0

type ArticleEntityAllDomainLinksVisitor interface {
	VisitStringList([]string) error
	VisitString(string) error
}
type ArticleEntityAllLinks struct {
	StringList []string
	String     string
	// contains filtered or unexported fields
}

A list of all URLs mentioned in the article.

func NewArticleEntityAllLinksFromString added in v1.1.0

func NewArticleEntityAllLinksFromString(value string) *ArticleEntityAllLinks

func NewArticleEntityAllLinksFromStringList added in v1.1.0

func NewArticleEntityAllLinksFromStringList(value []string) *ArticleEntityAllLinks

func (*ArticleEntityAllLinks) Accept added in v1.1.0

func (*ArticleEntityAllLinks) GetString added in v1.1.0

func (a *ArticleEntityAllLinks) GetString() string

func (*ArticleEntityAllLinks) GetStringList added in v1.1.0

func (a *ArticleEntityAllLinks) GetStringList() []string

func (ArticleEntityAllLinks) MarshalJSON added in v1.1.0

func (a ArticleEntityAllLinks) MarshalJSON() ([]byte, error)

func (*ArticleEntityAllLinks) UnmarshalJSON added in v1.1.0

func (a *ArticleEntityAllLinks) UnmarshalJSON(data []byte) error

type ArticleEntityAllLinksVisitor added in v1.1.0

type ArticleEntityAllLinksVisitor interface {
	VisitStringList([]string) error
	VisitString(string) error
}

type Articles added in v1.1.0

type Articles = []*ArticleEntity

A list of articles matching the search criteria.

type AuthorName added in v1.1.0

type AuthorName = string

The name of the author to search for. This parameter returns exact matches only.

type Authors

type Authors struct {
	StringList []string
	String     string
	// contains filtered or unexported fields
}

A list of authors of the article.

func NewAuthorsFromString

func NewAuthorsFromString(value string) *Authors

func NewAuthorsFromStringList

func NewAuthorsFromStringList(value []string) *Authors

func (*Authors) Accept

func (a *Authors) Accept(visitor AuthorsVisitor) error

func (*Authors) GetString

func (a *Authors) GetString() string

func (*Authors) GetStringList

func (a *Authors) GetStringList() []string

func (Authors) MarshalJSON

func (a Authors) MarshalJSON() ([]byte, error)

func (*Authors) UnmarshalJSON

func (a *Authors) UnmarshalJSON(data []byte) error

type AuthorsGetRequest

type AuthorsGetRequest struct {
	// The name of the author to search for. This parameter returns exact matches only.
	AuthorName string `json:"-" url:"author_name"`
	// The list of author names to exclude from your search. To exclude articles by specific authors, use a comma-separated string.
	//
	// Example: `"John Doe, Jane Doe"`
	NotAuthorName *string `json:"-" url:"not_author_name,omitempty"`
	// Predefined top news sources per country.
	//
	// Format: start with the word `top`, followed by the number of desired sources, and then the two-letter country code [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Multiple countries with the number of top sources can be specified as a comma-separated string.
	//
	// Examples:
	// - `"top 100 US"`
	// - `"top 33 AT"`
	// - `"top 50 US, top 20 GB"`
	// - `"top 33 AT, top 50 IT"`
	PredefinedSources *string `json:"-" url:"predefined_sources,omitempty"`
	// One or more news sources to narrow down the search. The format must be a domain URL. Subdomains, such as `finance.yahoo.com`, are also acceptable.To specify multiple sources, use a comma-separated string.
	//
	// Examples:
	// - `"nytimes.com"`
	// - `"theguardian.com, finance.yahoo.com"`
	Sources *string `json:"-" url:"sources,omitempty"`
	// The news sources to exclude from the search. To exclude multiple sources, use a comma-separated string.
	//
	// Example: `"cnn.com, wsj.com"`
	NotSources *string `json:"-" url:"not_sources,omitempty"`
	// The language(s) of the search. The only accepted format is the two-letter [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) code. To select multiple languages, use a comma-separated string.
	//
	// Example: `"en, es"`
	//
	// To learn more, see [Enumerated parameters > Language](/docs/v3/api-reference/overview/enumerated-parameters#language-lang-and-not-lang).
	Lang *string `json:"-" url:"lang,omitempty"`
	// The language(s) to exclude from the search. The accepted format is the two-letter [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) code. To exclude multiple languages, use a comma-separated string.
	//
	// Example: `"fr, de"`
	//
	// To learn more, see [Enumerated parameters > Language](/docs/v3/api-reference/overview/enumerated-parameters#language-lang-and-not-lang).
	NotLang *string `json:"-" url:"not_lang,omitempty"`
	// The countries where the news publisher is located. The accepted format is the two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. To select multiple countries, use a comma-separated string.
	//
	// Example: `"US, CA"`
	//
	// To learn more, see [Enumerated parameters > Country](/docs/v3/api-reference/overview/enumerated-parameters#country-country-and-not-country).
	Countries *string `json:"-" url:"countries,omitempty"`
	// The publisher location countries to exclude from the search. The accepted format is the two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. To exclude multiple countries, use a comma-separated string.
	//
	// Example:`"US, CA"`
	//
	// To learn more, see [Enumerated parameters > Country](/docs/v3/api-reference/overview/enumerated-parameters#country-country-and-not-country).
	NotCountries *string `json:"-" url:"not_countries,omitempty"`
	// The starting point in time to search from. Accepts date-time strings in ISO 8601 format and plain text. The default time zone is UTC.
	//
	// Formats with examples:
	// - YYYY-mm-ddTHH:MM:SS: `2024-07-01T00:00:00`
	// - YYYY-MM-dd: `2024-07-01`
	// - YYYY/mm/dd HH:MM:SS: `2024/07/01 00:00:00`
	// - YYYY/mm/dd: `2024/07/01`
	// - English phrases: `1 day ago`, `today`
	//
	// **Note**: By default, applied to the publication date of the article. To use the article's parse date instead, set the `by_parse_date` parameter to `true`.
	From *time.Time `json:"-" url:"from_,omitempty"`
	// The ending point in time to search up to. Accepts date-time strings in ISO 8601 format and plain text. The default time zone is UTC.
	//
	// Formats with examples:
	// - YYYY-mm-ddTHH:MM:SS: `2024-07-01T00:00:00`
	// - YYYY-MM-dd: `2024-07-01`
	// - YYYY/mm/dd HH:MM:SS: `2024/07/01 00:00:00`
	// - YYYY/mm/dd: `2024/07/01`
	// - English phrases: `1 day ago`, `today`
	//
	// **Note**: By default, applied to the publication date of the article. To use the article's parse date instead, set the `by_parse_date` parameter to `true`.
	To *time.Time `json:"-" url:"to_,omitempty"`
	// The precision of the published date. There are three types:
	// - `full`: The day and time of an article is correctly identified with the appropriate timezone.
	// - `timezone unknown`: The day and time of an article is correctly identified without timezone.
	// - `date`: Only the day is identified without an exact time.
	PublishedDatePrecision *AuthorsGetRequestPublishedDatePrecision `json:"-" url:"published_date_precision,omitempty"`
	// If true, the `from_` and `to_` parameters use article parse dates instead of published dates. Additionally, the `parse_date` variable is added to the output for each article object.
	ByParseDate *bool `json:"-" url:"by_parse_date,omitempty"`
	// The sorting order of the results. Possible values are:
	// - `relevancy`: The most relevant results first.
	// - `date`: The most recently published results first.
	// - `rank`: The results from the highest-ranked sources first.
	SortBy *AuthorsGetRequestSortBy `json:"-" url:"sort_by,omitempty"`
	// If true, limits the search to sources ranked in the top 1 million online websites. If false, includes unranked sources which are assigned a rank of 999999.
	RankedOnly *bool `json:"-" url:"ranked_only,omitempty"`
	// The lowest boundary of the rank of a news website to filter by. A lower rank indicates a more popular source.
	FromRank *int `json:"-" url:"from_rank,omitempty"`
	// The highest boundary of the rank of a news website to filter by. A lower rank indicates a more popular source.
	ToRank *int `json:"-" url:"to_rank,omitempty"`
	// If true, only returns articles that were posted on the home page of a given news domain.
	IsHeadline *bool `json:"-" url:"is_headline,omitempty"`
	// If true, returns only opinion pieces. If false, excludes opinion-based articles and returns news only.
	IsOpinion *bool `json:"-" url:"is_opinion,omitempty"`
	// If false, returns only articles that have publicly available complete content. Some publishers partially block content, so this setting ensures that only full articles are retrieved.
	IsPaidContent *bool `json:"-" url:"is_paid_content,omitempty"`
	// The categorical URL(s) to filter your search. To filter your search by multiple categorical URLs, use a comma-separated string.
	//
	// Example: `"wsj.com/politics, wsj.com/tech"`
	ParentUrl *string `json:"-" url:"parent_url,omitempty"`
	// The complete URL(s) mentioned in the article. For multiple URLs, use a comma-separated string.
	//
	// Example: `"https://aiindex.stanford.edu/report, https://www.stateof.ai"`
	//
	// For more details, see [Search by URL](/docs/v3/documentation/how-to/search-by-url).
	AllLinks *string `json:"-" url:"all_links,omitempty"`
	// The domain(s) mentioned in the article. For multiple domains, use a comma-separated string.
	//
	// Example: `"who.int, nih.gov"`
	//
	// For more details, see [Search by URL](/docs/v3/documentation/how-to/search-by-url).
	AllDomainLinks *string `json:"-" url:"all_domain_links,omitempty"`
	// The minimum number of words an article must contain. To be used for avoiding articles with small content.
	WordCountMin *int `json:"-" url:"word_count_min,omitempty"`
	// The maximum number of words an article can contain. To be used for avoiding articles with large content.
	WordCountMax *int `json:"-" url:"word_count_max,omitempty"`
	// The page number to scroll through the results. Use for pagination, as a single API response can return up to 1,000 articles.
	//
	// For details, see [How to paginate large datasets](https://www.newscatcherapi.com/docs/v3/documentation/how-to/paginate-large-datasets).
	Page *int `json:"-" url:"page,omitempty"`
	// The number of articles to return per page.
	PageSize *int `json:"-" url:"page_size,omitempty"`
	// If true, includes an NLP layer with each article in the response. This layer provides enhanced information such as theme classification, article summary, sentiment analysis, tags, and named entity recognition.
	//
	// The NLP layer includes:
	// - Theme: General topic of the article.
	// - Summary: A concise overview of the article content.
	// - Sentiment: Separate scores for title and content (range: -1 to 1).
	// - Named entities: Identified persons (PER), organizations (ORG), locations (LOC), and miscellaneous entities (MISC).
	// - IPTC tags: Standardized news category tags.
	// - IAB tags: Content categories for digital advertising.
	//
	// **Note**: The `include_nlp_data` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	IncludeNlpData *bool `json:"-" url:"include_nlp_data,omitempty"`
	// If true, filters the results to include only articles with an NLP layer. This allows you to focus on articles that have been processed with advanced NLP techniques.
	//
	// **Note**: The `has_nlp` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	HasNlp *bool `json:"-" url:"has_nlp,omitempty"`
	// Filters articles based on their general topic, as determined by NLP analysis. To select multiple themes, use a comma-separated string.
	//
	// Example: `"Finance, Tech"`
	//
	// **Note**: The `theme` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	//
	// Available options: `Business`, `Economics`, `Entertainment`, `Finance`, `Health`, `Politics`, `Science`, `Sports`, `Tech`, `Crime`, `Financial Crime`, `Lifestyle`, `Automotive`, `Travel`, `Weather`, `General`.
	Theme *string `json:"-" url:"theme,omitempty"`
	// Inverse of the `theme` parameter. Excludes articles based on their general topic, as determined by NLP analysis. To exclude multiple themes, use a comma-separated string.
	//
	// Example: `"Crime, Tech"`
	//
	// **Note**: The `not_theme` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	NotTheme *string `json:"-" url:"not_theme,omitempty"`
	// The name of person, organization, location, product or other named entity to search for. To specify multiple names use a comma-separated string.
	//
	// Example: `"Tesla, Amazon"`
	NerName *string `json:"-" url:"ner_name,omitempty"`
	// Filters articles based on the minimum sentiment score of their titles.
	//
	// Range is `-1.0` to `1.0`, where:
	// - Negative values indicate negative sentiment.
	// - Positive values indicate positive sentiment.
	// - Values close to 0 indicate neutral sentiment.
	//
	// **Note**: The `title_sentiment_min` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	TitleSentimentMin *float64 `json:"-" url:"title_sentiment_min,omitempty"`
	// Filters articles based on the maximum sentiment score of their titles.
	//
	// Range is `-1.0` to `1.0`, where:
	// - Negative values indicate negative sentiment.
	// - Positive values indicate positive sentiment.
	// - Values close to 0 indicate neutral sentiment.
	//
	// **Note**: The `title_sentiment_max` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	TitleSentimentMax *float64 `json:"-" url:"title_sentiment_max,omitempty"`
	// Filters articles based on the minimum sentiment score of their content.
	//
	// Range is `-1.0` to `1.0`, where:
	// - Negative values indicate negative sentiment.
	// - Positive values indicate positive sentiment.
	// - Values close to 0 indicate neutral sentiment.
	//
	// **Note**: The `content_sentiment_min` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	ContentSentimentMin *float64 `json:"-" url:"content_sentiment_min,omitempty"`
	// Filters articles based on the maximum sentiment score of their content.
	//
	// Range is `-1.0` to `1.0`, where:
	// - Negative values indicate negative sentiment.
	// - Positive values indicate positive sentiment.
	// - Values close to 0 indicate neutral sentiment.
	//
	// **Note**: The `content_sentiment_max` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	ContentSentimentMax *float64 `json:"-" url:"content_sentiment_max,omitempty"`
	// Filters articles based on International Press Telecommunications Council (IPTC) media topic tags. To specify multiple IPTC tags, use a comma-separated string of tag IDs.
	//
	// Example: `"20000199, 20000209"`
	//
	// **Note**: The `iptc_tags` parameter is only available if tags are included in your subscription plan.
	//
	// To learn more, see [IPTC Media Topic NewsCodes](https://www.iptc.org/std/NewsCodes/treeview/mediatopic/mediatopic-en-GB.html).
	IptcTags *string `json:"-" url:"iptc_tags,omitempty"`
	// Inverse of the `iptc_tags` parameter. Excludes articles based on International Press Telecommunications Council (IPTC) media topic tags. To specify multiple IPTC tags to exclude, use a comma-separated string of tag IDs.
	//
	// Example: `"20000205, 20000209"`
	//
	// **Note**: The `not_iptc_tags` parameter is only available if tags are included in your subscription plan.
	//
	// To learn more, see [IPTC Media Topic NewsCodes](https://www.iptc.org/std/NewsCodes/treeview/mediatopic/mediatopic-en-GB.html).
	NotIptcTags *string `json:"-" url:"not_iptc_tags,omitempty"`
	// Filters articles based on Interactive Advertising Bureau (IAB) content categories. These tags provide a standardized taxonomy for digital advertising content categorization. To specify multiple IAB categories, use a comma-separated string.
	//
	// Example: `"Business, Events"`
	//
	// **Note**: The `iab_tags` parameter is only available if tags are included in your subscription plan.
	//
	// To learn more, see the [IAB Content taxonomy](https://iabtechlab.com/standards/content-taxonomy/).
	IabTags *string `json:"-" url:"iab_tags,omitempty"`
	// Inverse of the `iab_tags` parameter. Excludes articles based on Interactive Advertising Bureau (IAB) content categories. These tags provide a standardized taxonomy for digital advertising content categorization. To specify multiple IAB categories to exclude, use a comma-separated string.
	//
	// Example: `"Agriculture, Metals"`
	//
	// **Note**: The `not_iab_tags` parameter is only available if tags are included in your subscription plan.
	//
	// To learn more, see the [IAB Content taxonomy](https://iabtechlab.com/standards/content-taxonomy/).
	NotIabTags *string `json:"-" url:"not_iab_tags,omitempty"`
	// Filters articles based on provided taxonomy that is tailored to your specific needs and is accessible only with your API key. To specify tags, use the following pattern:
	//
	// - `custom_tags.taxonomy=Tag1,Tag2,Tag3`, where `taxonomy` is the taxonomy name and `Tag1,Tag2,Tag3` is a comma-separated list of tags.
	//
	// Example: `custom_tags.industry="Manufacturing, Supply Chain, Logistics"`
	//
	// To learn more, see the [Custom tags](/docs/v3/documentation/guides-and-concepts/custom-tags).
	CustomTags *string `json:"-" url:"custom_tags,omitempty"`
}

type AuthorsGetRequestPublishedDatePrecision added in v1.1.0

type AuthorsGetRequestPublishedDatePrecision string
const (
	AuthorsGetRequestPublishedDatePrecisionFull            AuthorsGetRequestPublishedDatePrecision = "full"
	AuthorsGetRequestPublishedDatePrecisionTimezoneUnknown AuthorsGetRequestPublishedDatePrecision = "timezone unknown"
	AuthorsGetRequestPublishedDatePrecisionDate            AuthorsGetRequestPublishedDatePrecision = "date"
)

func NewAuthorsGetRequestPublishedDatePrecisionFromString added in v1.1.0

func NewAuthorsGetRequestPublishedDatePrecisionFromString(s string) (AuthorsGetRequestPublishedDatePrecision, error)

func (AuthorsGetRequestPublishedDatePrecision) Ptr added in v1.1.0

type AuthorsGetRequestSortBy added in v1.1.0

type AuthorsGetRequestSortBy string
const (
	AuthorsGetRequestSortByRelevancy AuthorsGetRequestSortBy = "relevancy"
	AuthorsGetRequestSortByDate      AuthorsGetRequestSortBy = "date"
	AuthorsGetRequestSortByRank      AuthorsGetRequestSortBy = "rank"
)

func NewAuthorsGetRequestSortByFromString added in v1.1.0

func NewAuthorsGetRequestSortByFromString(s string) (AuthorsGetRequestSortBy, error)

func (AuthorsGetRequestSortBy) Ptr added in v1.1.0

type AuthorsGetResponse

type AuthorsGetResponse struct {
	SearchResponseDto        *SearchResponseDto
	FailedAuthorsResponseDto *FailedAuthorsResponseDto
	// contains filtered or unexported fields
}

func NewAuthorsGetResponseFromFailedAuthorsResponseDto added in v1.1.0

func NewAuthorsGetResponseFromFailedAuthorsResponseDto(value *FailedAuthorsResponseDto) *AuthorsGetResponse

func NewAuthorsGetResponseFromSearchResponseDto added in v1.1.0

func NewAuthorsGetResponseFromSearchResponseDto(value *SearchResponseDto) *AuthorsGetResponse

func (*AuthorsGetResponse) Accept

func (*AuthorsGetResponse) GetFailedAuthorsResponseDto added in v1.1.0

func (a *AuthorsGetResponse) GetFailedAuthorsResponseDto() *FailedAuthorsResponseDto

func (*AuthorsGetResponse) GetSearchResponseDto added in v1.1.0

func (a *AuthorsGetResponse) GetSearchResponseDto() *SearchResponseDto

func (AuthorsGetResponse) MarshalJSON

func (a AuthorsGetResponse) MarshalJSON() ([]byte, error)

func (*AuthorsGetResponse) UnmarshalJSON

func (a *AuthorsGetResponse) UnmarshalJSON(data []byte) error

type AuthorsGetResponseVisitor

type AuthorsGetResponseVisitor interface {
	VisitSearchResponseDto(*SearchResponseDto) error
	VisitFailedAuthorsResponseDto(*FailedAuthorsResponseDto) error
}

type AuthorsPostRequest added in v1.1.0

type AuthorsPostRequest struct {
	AuthorName             AuthorName              `json:"author_name" url:"-"`
	NotAuthorName          *NotAuthorName          `json:"not_author_name,omitempty" url:"-"`
	PredefinedSources      *PredefinedSources      `json:"predefined_sources,omitempty" url:"-"`
	Sources                *Sources                `json:"sources,omitempty" url:"-"`
	NotSources             *NotSources             `json:"not_sources,omitempty" url:"-"`
	Lang                   *Lang                   `json:"lang,omitempty" url:"-"`
	NotLang                *NotLang                `json:"not_lang,omitempty" url:"-"`
	Countries              *Countries              `json:"countries,omitempty" url:"-"`
	NotCountries           *NotCountries           `json:"not_countries,omitempty" url:"-"`
	From                   *From                   `json:"from_,omitempty" url:"-"`
	To                     *To                     `json:"to_,omitempty" url:"-"`
	PublishedDatePrecision *PublishedDatePrecision `json:"published_date_precision,omitempty" url:"-"`
	ByParseDate            *ByParseDate            `json:"by_parse_date,omitempty" url:"-"`
	SortBy                 *SortBy                 `json:"sort_by,omitempty" url:"-"`
	RankedOnly             *RankedOnly             `json:"ranked_only,omitempty" url:"-"`
	FromRank               *FromRank               `json:"from_rank,omitempty" url:"-"`
	ToRank                 *ToRank                 `json:"to_rank,omitempty" url:"-"`
	IsHeadline             *IsHeadline             `json:"is_headline,omitempty" url:"-"`
	IsOpinion              *IsOpinion              `json:"is_opinion,omitempty" url:"-"`
	IsPaidContent          *IsPaidContent          `json:"is_paid_content,omitempty" url:"-"`
	ParentUrl              *ParentUrl              `json:"parent_url,omitempty" url:"-"`
	AllLinks               *AllLinks               `json:"all_links,omitempty" url:"-"`
	AllDomainLinks         *AllDomainLinks         `json:"all_domain_links,omitempty" url:"-"`
	WordCountMin           *WordCountMin           `json:"word_count_min,omitempty" url:"-"`
	WordCountMax           *WordCountMax           `json:"word_count_max,omitempty" url:"-"`
	Page                   *Page                   `json:"page,omitempty" url:"-"`
	PageSize               *PageSize               `json:"page_size,omitempty" url:"-"`
	IncludeNlpData         *IncludeNlpData         `json:"include_nlp_data,omitempty" url:"-"`
	HasNlp                 *HasNlp                 `json:"has_nlp,omitempty" url:"-"`
	Theme                  *Theme                  `json:"theme,omitempty" url:"-"`
	NotTheme               *NotTheme               `json:"not_theme,omitempty" url:"-"`
	NerName                *NerName                `json:"ner_name,omitempty" url:"-"`
	TitleSentimentMin      *TitleSentimentMin      `json:"title_sentiment_min,omitempty" url:"-"`
	TitleSentimentMax      *TitleSentimentMax      `json:"title_sentiment_max,omitempty" url:"-"`
	ContentSentimentMin    *ContentSentimentMin    `json:"content_sentiment_min,omitempty" url:"-"`
	ContentSentimentMax    *ContentSentimentMax    `json:"content_sentiment_max,omitempty" url:"-"`
	IptcTags               *IptcTags               `json:"iptc_tags,omitempty" url:"-"`
	NotIptcTags            *NotIptcTags            `json:"not_iptc_tags,omitempty" url:"-"`
	IabTags                *IabTags                `json:"iab_tags,omitempty" url:"-"`
	NotIabTags             *NotIabTags             `json:"not_iab_tags,omitempty" url:"-"`
	CustomTags             *CustomTags             `json:"custom_tags,omitempty" url:"-"`
}

type AuthorsPostResponse

type AuthorsPostResponse struct {
	SearchResponseDto        *SearchResponseDto
	FailedAuthorsResponseDto *FailedAuthorsResponseDto
	// contains filtered or unexported fields
}

func NewAuthorsPostResponseFromFailedAuthorsResponseDto added in v1.1.0

func NewAuthorsPostResponseFromFailedAuthorsResponseDto(value *FailedAuthorsResponseDto) *AuthorsPostResponse

func NewAuthorsPostResponseFromSearchResponseDto added in v1.1.0

func NewAuthorsPostResponseFromSearchResponseDto(value *SearchResponseDto) *AuthorsPostResponse

func (*AuthorsPostResponse) Accept

func (*AuthorsPostResponse) GetFailedAuthorsResponseDto added in v1.1.0

func (a *AuthorsPostResponse) GetFailedAuthorsResponseDto() *FailedAuthorsResponseDto

func (*AuthorsPostResponse) GetSearchResponseDto added in v1.1.0

func (a *AuthorsPostResponse) GetSearchResponseDto() *SearchResponseDto

func (AuthorsPostResponse) MarshalJSON

func (a AuthorsPostResponse) MarshalJSON() ([]byte, error)

func (*AuthorsPostResponse) UnmarshalJSON

func (a *AuthorsPostResponse) UnmarshalJSON(data []byte) error

type AuthorsPostResponseVisitor

type AuthorsPostResponseVisitor interface {
	VisitSearchResponseDto(*SearchResponseDto) error
	VisitFailedAuthorsResponseDto(*FailedAuthorsResponseDto) error
}

type AuthorsVisitor

type AuthorsVisitor interface {
	VisitStringList([]string) error
	VisitString(string) error
}

type BadRequestError added in v1.1.0

type BadRequestError struct {
	*core.APIError
	Body *Error
}

Bad request

func (*BadRequestError) MarshalJSON added in v1.1.0

func (b *BadRequestError) MarshalJSON() ([]byte, error)

func (*BadRequestError) UnmarshalJSON added in v1.1.0

func (b *BadRequestError) UnmarshalJSON(data []byte) error

func (*BadRequestError) Unwrap added in v1.1.0

func (b *BadRequestError) Unwrap() error

type BaseSearchResponseDto added in v1.1.0

type BaseSearchResponseDto struct {
	// The status of the response.
	Status string `json:"status" url:"status"`
	// The total number of articles matching the search criteria.
	TotalHits int `json:"total_hits" url:"total_hits"`
	// The current page number of the results.
	Page int `json:"page" url:"page"`
	// The total number of pages available for the given search criteria.
	TotalPages int `json:"total_pages" url:"total_pages"`
	// The number of articles per page.
	PageSize int `json:"page_size" url:"page_size"`
	// contains filtered or unexported fields
}

The base response model containing common fields for search operations.

func (*BaseSearchResponseDto) GetExtraProperties added in v1.1.0

func (b *BaseSearchResponseDto) GetExtraProperties() map[string]interface{}

func (*BaseSearchResponseDto) GetPage added in v1.1.0

func (b *BaseSearchResponseDto) GetPage() int

func (*BaseSearchResponseDto) GetPageSize added in v1.1.0

func (b *BaseSearchResponseDto) GetPageSize() int

func (*BaseSearchResponseDto) GetStatus added in v1.1.0

func (b *BaseSearchResponseDto) GetStatus() string

func (*BaseSearchResponseDto) GetTotalHits added in v1.1.0

func (b *BaseSearchResponseDto) GetTotalHits() int

func (*BaseSearchResponseDto) GetTotalPages added in v1.1.0

func (b *BaseSearchResponseDto) GetTotalPages() int

func (*BaseSearchResponseDto) String added in v1.1.0

func (b *BaseSearchResponseDto) String() string

func (*BaseSearchResponseDto) UnmarshalJSON added in v1.1.0

func (b *BaseSearchResponseDto) UnmarshalJSON(data []byte) error

type ByParseDate added in v1.1.0

type ByParseDate = bool

If true, the `from_` and `to_` parameters use article parse dates instead of published dates. Additionally, the `parse_date` variable is added to the output for each article object.

type ClusterEntity added in v1.1.0

type ClusterEntity struct {
	// The unique identifier for the cluster.
	ClusterId string `json:"cluster_id" url:"cluster_id"`
	// The number of articles in the cluster.
	ClusterSize int `json:"cluster_size" url:"cluster_size"`
	// A list of articles in the cluster.
	Articles []*ArticleEntity `json:"articles,omitempty" url:"articles,omitempty"`
	// contains filtered or unexported fields
}

The data model representing a single cluster of articles.

func (*ClusterEntity) GetArticles added in v1.1.0

func (c *ClusterEntity) GetArticles() []*ArticleEntity

func (*ClusterEntity) GetClusterId added in v1.1.0

func (c *ClusterEntity) GetClusterId() string

func (*ClusterEntity) GetClusterSize added in v1.1.0

func (c *ClusterEntity) GetClusterSize() int

func (*ClusterEntity) GetExtraProperties added in v1.1.0

func (c *ClusterEntity) GetExtraProperties() map[string]interface{}

func (*ClusterEntity) String added in v1.1.0

func (c *ClusterEntity) String() string

func (*ClusterEntity) UnmarshalJSON added in v1.1.0

func (c *ClusterEntity) UnmarshalJSON(data []byte) error

type ClusteredArticlesDto added in v1.1.0

type ClusteredArticlesDto struct {
	// The number of clusters in the search results.
	ClustersCount int `json:"clusters_count" url:"clusters_count"`
	// A list of clusters found in the search results.
	Clusters []*ClusterEntity `json:"clusters,omitempty" url:"clusters,omitempty"`
	// contains filtered or unexported fields
}

func (*ClusteredArticlesDto) GetClusters added in v1.1.0

func (c *ClusteredArticlesDto) GetClusters() []*ClusterEntity

func (*ClusteredArticlesDto) GetClustersCount added in v1.1.0

func (c *ClusteredArticlesDto) GetClustersCount() int

func (*ClusteredArticlesDto) GetExtraProperties added in v1.1.0

func (c *ClusteredArticlesDto) GetExtraProperties() map[string]interface{}

func (*ClusteredArticlesDto) String added in v1.1.0

func (c *ClusteredArticlesDto) String() string

func (*ClusteredArticlesDto) UnmarshalJSON added in v1.1.0

func (c *ClusteredArticlesDto) UnmarshalJSON(data []byte) error

type ClusteredSearchResponseDto added in v1.1.0

type ClusteredSearchResponseDto struct {
	// The status of the response.
	Status string `json:"status" url:"status"`
	// The total number of articles matching the search criteria.
	TotalHits int `json:"total_hits" url:"total_hits"`
	// The current page number of the results.
	Page int `json:"page" url:"page"`
	// The total number of pages available for the given search criteria.
	TotalPages int `json:"total_pages" url:"total_pages"`
	// The number of articles per page.
	PageSize int `json:"page_size" url:"page_size"`
	// The number of clusters in the search results.
	ClustersCount int `json:"clusters_count" url:"clusters_count"`
	// A list of clusters found in the search results.
	Clusters  []*ClusterEntity `json:"clusters,omitempty" url:"clusters,omitempty"`
	UserInput *UserInputDto    `json:"user_input,omitempty" url:"user_input,omitempty"`
	// contains filtered or unexported fields
}

The response model when clustering is enabled, grouping similar articles into clusters. Applies to the `Search` and `Latest headlines` requests. Response field behavior: - Required fields are guaranteed to be present and non-null. - Optional fields may be `null`/`undefined` if the data couldn't be extracted during processing. - To access article properties in the `articles` response array, use array index notation. For example, `articles[n].title`, where `n` is the zero-based index of the article object (0, 1, 2, etc.). - The `nlp` property within the article object `articles[n].nlp` is only available with NLP-enabled subscription plans.

func (*ClusteredSearchResponseDto) GetClusters added in v1.1.0

func (c *ClusteredSearchResponseDto) GetClusters() []*ClusterEntity

func (*ClusteredSearchResponseDto) GetClustersCount added in v1.1.0

func (c *ClusteredSearchResponseDto) GetClustersCount() int

func (*ClusteredSearchResponseDto) GetExtraProperties added in v1.1.0

func (c *ClusteredSearchResponseDto) GetExtraProperties() map[string]interface{}

func (*ClusteredSearchResponseDto) GetPage added in v1.1.0

func (c *ClusteredSearchResponseDto) GetPage() int

func (*ClusteredSearchResponseDto) GetPageSize added in v1.1.0

func (c *ClusteredSearchResponseDto) GetPageSize() int

func (*ClusteredSearchResponseDto) GetStatus added in v1.1.0

func (c *ClusteredSearchResponseDto) GetStatus() string

func (*ClusteredSearchResponseDto) GetTotalHits added in v1.1.0

func (c *ClusteredSearchResponseDto) GetTotalHits() int

func (*ClusteredSearchResponseDto) GetTotalPages added in v1.1.0

func (c *ClusteredSearchResponseDto) GetTotalPages() int

func (*ClusteredSearchResponseDto) GetUserInput added in v1.1.0

func (c *ClusteredSearchResponseDto) GetUserInput() *UserInputDto

func (*ClusteredSearchResponseDto) String added in v1.1.0

func (c *ClusteredSearchResponseDto) String() string

func (*ClusteredSearchResponseDto) UnmarshalJSON added in v1.1.0

func (c *ClusteredSearchResponseDto) UnmarshalJSON(data []byte) error

type ClusteringEnabled added in v1.1.0

type ClusteringEnabled = bool

Determines whether to group similar articles into clusters. If true, the API returns clustered results.

To learn more, see [Clustering news articles](/docs/v3/documentation/guides-and-concepts/clustering-news-articles).

type ClusteringThreshold added in v1.1.0

type ClusteringThreshold = float64

Sets the similarity threshold for grouping articles into clusters. A lower value creates more inclusive clusters, while a higher value requires greater similarity between articles.

For example: - `0.3`: Results in larger, more diverse clusters. - `0.6`: Balances cluster size and article similarity (default). - `0.9`: Creates smaller, tightly related clusters.

To learn more, see [Clustering news articles](/docs/v3/documentation/guides-and-concepts/clustering-news-articles).

type ClusteringVariable added in v1.1.0

type ClusteringVariable string

Specifies which part of the article to use for determining similarity when clustering. Possible values are: - `content`: Uses the full article content (default). - `title`: Uses only the article title. - `summary`: Uses the article summary.

To learn more, see [Clustering news articles](/docs/v3/documentation/guides-and-concepts/clustering-news-articles).

const (
	ClusteringVariableContent ClusteringVariable = "content"
	ClusteringVariableTitle   ClusteringVariable = "title"
	ClusteringVariableSummary ClusteringVariable = "summary"
)

func NewClusteringVariableFromString added in v1.1.0

func NewClusteringVariableFromString(s string) (ClusteringVariable, error)

func (ClusteringVariable) Ptr added in v1.1.0

type ContentSentimentMax added in v1.1.0

type ContentSentimentMax = float64

Filters articles based on the maximum sentiment score of their content.

Range is `-1.0` to `1.0`, where: - Negative values indicate negative sentiment. - Positive values indicate positive sentiment. - Values close to 0 indicate neutral sentiment.

**Note**: The `content_sentiment_max` parameter is only available if NLP is included in your subscription plan.

To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).

type ContentSentimentMin added in v1.1.0

type ContentSentimentMin = float64

Filters articles based on the minimum sentiment score of their content.

Range is `-1.0` to `1.0`, where: - Negative values indicate negative sentiment. - Positive values indicate positive sentiment. - Values close to 0 indicate neutral sentiment.

**Note**: The `content_sentiment_min` parameter is only available if NLP is included in your subscription plan.

To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).

type Countries added in v1.1.0

type Countries struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

The countries where the news publisher is located. The accepted format is the two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. To select multiple countries, use a comma-separated string or an array of strings.

Examples: - `"US,CA"` - `["US", "CA"]`

To learn more, see [Enumerated parameters > Country](/docs/v3/api-reference/overview/enumerated-parameters#country-country-and-not-country).

func NewCountriesFromString added in v1.1.0

func NewCountriesFromString(value string) *Countries

func NewCountriesFromStringList added in v1.1.0

func NewCountriesFromStringList(value []string) *Countries

func (*Countries) Accept added in v1.1.0

func (c *Countries) Accept(visitor CountriesVisitor) error

func (*Countries) GetString added in v1.1.0

func (c *Countries) GetString() string

func (*Countries) GetStringList added in v1.1.0

func (c *Countries) GetStringList() []string

func (Countries) MarshalJSON added in v1.1.0

func (c Countries) MarshalJSON() ([]byte, error)

func (*Countries) UnmarshalJSON added in v1.1.0

func (c *Countries) UnmarshalJSON(data []byte) error

type CountriesVisitor added in v1.1.0

type CountriesVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}

type CustomTags added in v1.1.0

type CustomTags struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

Filters articles based on provided taxonomy that is tailored to your specific needs and is accessible only with your API key. To specify tags, use the following pattern:

- `custom_tags.taxonomy=Tag1,Tag2,Tag3`, where `taxonomy` is the taxonomy name and `Tag1,Tag2,Tag3` are comma-separated tags. For POST requests, you can also specify tags as an array of strings.

Examples: - `custom_tags.industry="Manufacturing, Supply Chain, Logistics"` - `"custom_tags.industry": ["Manufacturing", "Supply Chain", "Logistics"]`

To learn more, see the [Custom tags](/docs/v3/documentation/guides-and-concepts/custom-tags).

func NewCustomTagsFromString added in v1.1.0

func NewCustomTagsFromString(value string) *CustomTags

func NewCustomTagsFromStringList added in v1.1.0

func NewCustomTagsFromStringList(value []string) *CustomTags

func (*CustomTags) Accept added in v1.1.0

func (c *CustomTags) Accept(visitor CustomTagsVisitor) error

func (*CustomTags) GetString added in v1.1.0

func (c *CustomTags) GetString() string

func (*CustomTags) GetStringList added in v1.1.0

func (c *CustomTags) GetStringList() []string

func (CustomTags) MarshalJSON added in v1.1.0

func (c CustomTags) MarshalJSON() ([]byte, error)

func (*CustomTags) UnmarshalJSON added in v1.1.0

func (c *CustomTags) UnmarshalJSON(data []byte) error

type CustomTagsVisitor added in v1.1.0

type CustomTagsVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}

type Error added in v1.1.0

type Error struct {
	// A detailed description of the error.
	Message string `json:"message" url:"message"`
	// The HTTP status code of the error.
	StatusCode int `json:"status_code" url:"status_code"`
	// A short description of the status code.
	Status string `json:"status" url:"status"`
	// contains filtered or unexported fields
}

func (*Error) GetExtraProperties added in v1.1.0

func (e *Error) GetExtraProperties() map[string]interface{}

func (*Error) GetMessage added in v1.1.0

func (e *Error) GetMessage() string

func (*Error) GetStatus added in v1.1.0

func (e *Error) GetStatus() string

func (*Error) GetStatusCode added in v1.1.0

func (e *Error) GetStatusCode() int

func (*Error) String added in v1.1.0

func (e *Error) String() string

func (*Error) UnmarshalJSON added in v1.1.0

func (e *Error) UnmarshalJSON(data []byte) error

type ExcludeDuplicates added in v1.1.0

type ExcludeDuplicates = bool

If true, excludes duplicate and highly similar articles from the search results. If false, returns all relevant articles, including duplicates.

To learn more, see [Articles deduplication](/docs/v3/documentation/guides-and-concepts/articles-deduplication).

type FailedAggregationCountResponseDto added in v1.1.0

type FailedAggregationCountResponseDto struct {
	// The status of the response.
	Status string `json:"status" url:"status"`
	// The total number of articles matching the search criteria.
	TotalHits int `json:"total_hits" url:"total_hits"`
	// The current page number of the results.
	Page int `json:"page" url:"page"`
	// The total number of pages available for the given search criteria.
	TotalPages int `json:"total_pages" url:"total_pages"`
	// The number of articles per page.
	PageSize  int           `json:"page_size" url:"page_size"`
	UserInput *UserInputDto `json:"user_input,omitempty" url:"user_input,omitempty"`
	// contains filtered or unexported fields
}

The response model for a failed `Aggregation count` request.

func (*FailedAggregationCountResponseDto) GetExtraProperties added in v1.1.0

func (f *FailedAggregationCountResponseDto) GetExtraProperties() map[string]interface{}

func (*FailedAggregationCountResponseDto) GetPage added in v1.1.0

func (*FailedAggregationCountResponseDto) GetPageSize added in v1.1.0

func (f *FailedAggregationCountResponseDto) GetPageSize() int

func (*FailedAggregationCountResponseDto) GetStatus added in v1.1.0

func (*FailedAggregationCountResponseDto) GetTotalHits added in v1.1.0

func (f *FailedAggregationCountResponseDto) GetTotalHits() int

func (*FailedAggregationCountResponseDto) GetTotalPages added in v1.1.0

func (f *FailedAggregationCountResponseDto) GetTotalPages() int

func (*FailedAggregationCountResponseDto) GetUserInput added in v1.1.0

func (*FailedAggregationCountResponseDto) String added in v1.1.0

func (*FailedAggregationCountResponseDto) UnmarshalJSON added in v1.1.0

func (f *FailedAggregationCountResponseDto) UnmarshalJSON(data []byte) error

type FailedAuthorsResponseDto added in v1.1.0

type FailedAuthorsResponseDto struct {
	// The status of the response.
	Status string `json:"status" url:"status"`
	// The total number of articles matching the search criteria.
	TotalHits int `json:"total_hits" url:"total_hits"`
	// The current page number of the results.
	Page int `json:"page" url:"page"`
	// The total number of pages available for the given search criteria.
	TotalPages int `json:"total_pages" url:"total_pages"`
	// The number of articles per page.
	PageSize int `json:"page_size" url:"page_size"`
	// An empty list of articles, as no matches were found.
	Articles  []map[string]interface{} `json:"articles,omitempty" url:"articles,omitempty"`
	UserInput *UserInputDto            `json:"user_input,omitempty" url:"user_input,omitempty"`
	// contains filtered or unexported fields
}

The response model for a failed `Authors` search request.

func (*FailedAuthorsResponseDto) GetArticles added in v1.1.0

func (f *FailedAuthorsResponseDto) GetArticles() []map[string]interface{}

func (*FailedAuthorsResponseDto) GetExtraProperties added in v1.1.0

func (f *FailedAuthorsResponseDto) GetExtraProperties() map[string]interface{}

func (*FailedAuthorsResponseDto) GetPage added in v1.1.0

func (f *FailedAuthorsResponseDto) GetPage() int

func (*FailedAuthorsResponseDto) GetPageSize added in v1.1.0

func (f *FailedAuthorsResponseDto) GetPageSize() int

func (*FailedAuthorsResponseDto) GetStatus added in v1.1.0

func (f *FailedAuthorsResponseDto) GetStatus() string

func (*FailedAuthorsResponseDto) GetTotalHits added in v1.1.0

func (f *FailedAuthorsResponseDto) GetTotalHits() int

func (*FailedAuthorsResponseDto) GetTotalPages added in v1.1.0

func (f *FailedAuthorsResponseDto) GetTotalPages() int

func (*FailedAuthorsResponseDto) GetUserInput added in v1.1.0

func (f *FailedAuthorsResponseDto) GetUserInput() *UserInputDto

func (*FailedAuthorsResponseDto) String added in v1.1.0

func (f *FailedAuthorsResponseDto) String() string

func (*FailedAuthorsResponseDto) UnmarshalJSON added in v1.1.0

func (f *FailedAuthorsResponseDto) UnmarshalJSON(data []byte) error

type FailedSearchSimilarResponseDto added in v1.1.0

type FailedSearchSimilarResponseDto struct {
	// The status of the response.
	Status string `json:"status" url:"status"`
	// The total number of articles matching the search criteria.
	TotalHits int `json:"total_hits" url:"total_hits"`
	// The current page number of the results.
	Page int `json:"page" url:"page"`
	// The total number of pages available for the given search criteria.
	TotalPages int `json:"total_pages" url:"total_pages"`
	// The number of articles per page.
	PageSize int `json:"page_size" url:"page_size"`
	// An empty list of articles, as no matches were found.
	Articles  []map[string]interface{} `json:"articles,omitempty" url:"articles,omitempty"`
	UserInput *UserInputDto            `json:"user_input,omitempty" url:"user_input,omitempty"`
	// contains filtered or unexported fields
}

The response model for a failed `Search Similar` request.

func (*FailedSearchSimilarResponseDto) GetArticles added in v1.1.0

func (f *FailedSearchSimilarResponseDto) GetArticles() []map[string]interface{}

func (*FailedSearchSimilarResponseDto) GetExtraProperties added in v1.1.0

func (f *FailedSearchSimilarResponseDto) GetExtraProperties() map[string]interface{}

func (*FailedSearchSimilarResponseDto) GetPage added in v1.1.0

func (f *FailedSearchSimilarResponseDto) GetPage() int

func (*FailedSearchSimilarResponseDto) GetPageSize added in v1.1.0

func (f *FailedSearchSimilarResponseDto) GetPageSize() int

func (*FailedSearchSimilarResponseDto) GetStatus added in v1.1.0

func (f *FailedSearchSimilarResponseDto) GetStatus() string

func (*FailedSearchSimilarResponseDto) GetTotalHits added in v1.1.0

func (f *FailedSearchSimilarResponseDto) GetTotalHits() int

func (*FailedSearchSimilarResponseDto) GetTotalPages added in v1.1.0

func (f *FailedSearchSimilarResponseDto) GetTotalPages() int

func (*FailedSearchSimilarResponseDto) GetUserInput added in v1.1.0

func (f *FailedSearchSimilarResponseDto) GetUserInput() *UserInputDto

func (*FailedSearchSimilarResponseDto) String added in v1.1.0

func (*FailedSearchSimilarResponseDto) UnmarshalJSON added in v1.1.0

func (f *FailedSearchSimilarResponseDto) UnmarshalJSON(data []byte) error

type FileParam

type FileParam struct {
	io.Reader
	// contains filtered or unexported fields
}

FileParam is a file type suitable for multipart/form-data uploads.

func NewFileParam

func NewFileParam(
	reader io.Reader,
	filename string,
	contentType string,
	opts ...FileParamOption,
) *FileParam

NewFileParam returns a *FileParam type suitable for multipart/form-data uploads. All file upload endpoints accept a simple io.Reader, which is usually created by opening a file via os.Open.

However, some endpoints require additional metadata about the file such as a specific Content-Type or custom filename. FileParam makes it easier to create the correct type signature for these endpoints.

func (*FileParam) ContentType

func (f *FileParam) ContentType() string

func (*FileParam) Name

func (f *FileParam) Name() string

type FileParamOption

type FileParamOption interface {
	// contains filtered or unexported methods
}

FileParamOption adapts the behavior of the FileParam. No options are implemented yet, but this interface allows for future extensibility.

type ForbiddenError added in v1.1.0

type ForbiddenError struct {
	*core.APIError
	Body *Error
}

Forbidden - Server refuses action

func (*ForbiddenError) MarshalJSON added in v1.1.0

func (f *ForbiddenError) MarshalJSON() ([]byte, error)

func (*ForbiddenError) UnmarshalJSON added in v1.1.0

func (f *ForbiddenError) UnmarshalJSON(data []byte) error

func (*ForbiddenError) Unwrap added in v1.1.0

func (f *ForbiddenError) Unwrap() error

type From added in v1.1.0

type From struct {
	DateTime time.Time
	String   string
	// contains filtered or unexported fields
}

The starting point in time to search from. Accepts date-time strings in ISO 8601 format and plain text strings. The default time zone is UTC.

Formats with examples: - YYYY-mm-ddTHH:MM:SS: `2024-07-01T00:00:00` - YYYY-MM-dd: `2024-07-01` - YYYY/mm/dd HH:MM:SS: `2024/07/01 00:00:00` - YYYY/mm/dd: `2024/07/01` - English phrases: `1 day ago`, `today`

**Note**: By default, applied to the publication date of the article. To use the article's parse date instead, set the `by_parse_date` parameter to `true`.

func NewFromFromDateTime added in v1.1.0

func NewFromFromDateTime(value time.Time) *From

func NewFromFromString added in v1.1.0

func NewFromFromString(value string) *From

func (*From) Accept added in v1.1.0

func (f *From) Accept(visitor FromVisitor) error

func (*From) GetDateTime added in v1.1.0

func (f *From) GetDateTime() time.Time

func (*From) GetString added in v1.1.0

func (f *From) GetString() string

func (From) MarshalJSON added in v1.1.0

func (f From) MarshalJSON() ([]byte, error)

func (*From) UnmarshalJSON added in v1.1.0

func (f *From) UnmarshalJSON(data []byte) error

type FromRank added in v1.1.0

type FromRank = int

The lowest boundary of the rank of a news website to filter by. A lower rank indicates a more popular source.

type FromVisitor added in v1.1.0

type FromVisitor interface {
	VisitDateTime(time.Time) error
	VisitString(string) error
}

type HasNlp added in v1.1.0

type HasNlp = bool

If true, filters the results to include only articles with an NLP layer. This allows you to focus on articles that have been processed with advanced NLP techniques.

**Note**: The `has_nlp` parameter is only available if NLP is included in your subscription plan.

To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).

type IabTags added in v1.1.0

type IabTags struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

Filters articles based on Interactive Advertising Bureau (IAB) content categories.These tags provide a standardized taxonomy for digital advertising content categorization. To specify multiple IAB categories, use a comma-separated string or an array of strings.

Examples: - `"Business, Events"` - `["Business", "Events"]`

**Note**: The `iab_tags` parameter is only available if tags are included in your subscription plan.

To learn more, see the [IAB Content taxonomy](https://iabtechlab.com/standards/content-taxonomy/).

func NewIabTagsFromString added in v1.1.0

func NewIabTagsFromString(value string) *IabTags

func NewIabTagsFromStringList added in v1.1.0

func NewIabTagsFromStringList(value []string) *IabTags

func (*IabTags) Accept added in v1.1.0

func (i *IabTags) Accept(visitor IabTagsVisitor) error

func (*IabTags) GetString added in v1.1.0

func (i *IabTags) GetString() string

func (*IabTags) GetStringList added in v1.1.0

func (i *IabTags) GetStringList() []string

func (IabTags) MarshalJSON added in v1.1.0

func (i IabTags) MarshalJSON() ([]byte, error)

func (*IabTags) UnmarshalJSON added in v1.1.0

func (i *IabTags) UnmarshalJSON(data []byte) error

type IabTagsVisitor added in v1.1.0

type IabTagsVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}

type Ids added in v1.1.0

type Ids struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

The Newscatcher article ID (corresponds to the `_id` field in API response) or a list of article IDs to search for. To specify multiple IDs, use a comma-separated string or an array of strings.

Examples: - `"5f8d0d55b6e45e00179c6e7e,5f8d0d55b6e45e00179c6e7f"` - `["5f8d0d55b6e45e00179c6e7e","5f8d0d55b6e45e00179c6e7f"]`

**Caution**: You can use either the `links` or the `ids` parameter, but not both at the same time.

func NewIdsFromString added in v1.1.0

func NewIdsFromString(value string) *Ids

func NewIdsFromStringList added in v1.1.0

func NewIdsFromStringList(value []string) *Ids

func (*Ids) Accept added in v1.1.0

func (i *Ids) Accept(visitor IdsVisitor) error

func (*Ids) GetString added in v1.1.0

func (i *Ids) GetString() string

func (*Ids) GetStringList added in v1.1.0

func (i *Ids) GetStringList() []string

func (Ids) MarshalJSON added in v1.1.0

func (i Ids) MarshalJSON() ([]byte, error)

func (*Ids) UnmarshalJSON added in v1.1.0

func (i *Ids) UnmarshalJSON(data []byte) error

type IdsVisitor added in v1.1.0

type IdsVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}

type IncludeAdditionalInfo added in v1.1.0

type IncludeAdditionalInfo = bool

If true, returns the following additional datapoints about each news source: - `nb_articles_for_7d`: The number of articles published by the source in the last week. - `country`: Source country of origin. - `rank`: SEO rank. - `is_news_domain`: Boolean indicating if the source is a news domain. - `news_domain_type`: Type of news domain (e.g., "Original Content"). - `news_type`: Category of news (e.g., "General News Outlets").

type IncludeNlpData added in v1.1.0

type IncludeNlpData = bool

If true, includes an NLP layer with each article in the response. This layer provides enhanced information such as theme classification, article summary, sentiment analysis, tags, and named entity recognition.

The NLP layer includes: - Theme: General topic of the article. - Summary: A concise overview of the article content. - Sentiment: Separate scores for title and content (range: -1 to 1). - Named entities: Identified persons (PER), organizations (ORG), locations (LOC), and miscellaneous entities (MISC). - IPTC tags: Standardized news category tags. - IAB tags: Content categories for digital advertising.

**Note**: The `include_nlp_data` parameter is only available if NLP is included in your subscription plan.

To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).

type IncludeSimilarDocuments added in v1.1.0

type IncludeSimilarDocuments = bool

If true, includes similar documents in the response.

type InternalServerError added in v1.1.0

type InternalServerError struct {
	*core.APIError
	Body string
}

Internal server error

func (*InternalServerError) MarshalJSON added in v1.1.0

func (i *InternalServerError) MarshalJSON() ([]byte, error)

func (*InternalServerError) UnmarshalJSON added in v1.1.0

func (i *InternalServerError) UnmarshalJSON(data []byte) error

func (*InternalServerError) Unwrap added in v1.1.0

func (i *InternalServerError) Unwrap() error

type IptcTags added in v1.1.0

type IptcTags struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

Filters articles based on International Press Telecommunications Council (IPTC) media topic tags. To specify multiple IPTC tags, use a comma-separated string or an array of strings.

Examples: - `"20000199, 20000209"` - `["20000199", "20000209"]`

**Note**: The `iptc_tags` parameter is only available if tags are included in your subscription plan.

To learn more, see [IPTC Media Topic NewsCodes](https://www.iptc.org/std/NewsCodes/treeview/mediatopic/mediatopic-en-GB.html).

func NewIptcTagsFromString added in v1.1.0

func NewIptcTagsFromString(value string) *IptcTags

func NewIptcTagsFromStringList added in v1.1.0

func NewIptcTagsFromStringList(value []string) *IptcTags

func (*IptcTags) Accept added in v1.1.0

func (i *IptcTags) Accept(visitor IptcTagsVisitor) error

func (*IptcTags) GetString added in v1.1.0

func (i *IptcTags) GetString() string

func (*IptcTags) GetStringList added in v1.1.0

func (i *IptcTags) GetStringList() []string

func (IptcTags) MarshalJSON added in v1.1.0

func (i IptcTags) MarshalJSON() ([]byte, error)

func (*IptcTags) UnmarshalJSON added in v1.1.0

func (i *IptcTags) UnmarshalJSON(data []byte) error

type IptcTagsVisitor added in v1.1.0

type IptcTagsVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}

type IsHeadline added in v1.1.0

type IsHeadline = bool

If true, only returns articles that were posted on the home page of a given news domain.

type IsNewsDomain added in v1.1.0

type IsNewsDomain = bool

If true, filters results to include only news domains.

type IsOpinion added in v1.1.0

type IsOpinion = bool

If true, returns only opinion pieces. If false, excludes opinion-based articles and returns news only.

type IsPaidContent added in v1.1.0

type IsPaidContent = bool

If false, returns only articles that have publicly available complete content. Some publishers partially block content, so this setting ensures that only full articles are retrieved.

type Journalists

type Journalists struct {
	StringList []string
	String     string
	// contains filtered or unexported fields
}

A list of journalists associated with the article.

func NewJournalistsFromString

func NewJournalistsFromString(value string) *Journalists

func NewJournalistsFromStringList

func NewJournalistsFromStringList(value []string) *Journalists

func (*Journalists) Accept

func (j *Journalists) Accept(visitor JournalistsVisitor) error

func (*Journalists) GetString

func (j *Journalists) GetString() string

func (*Journalists) GetStringList

func (j *Journalists) GetStringList() []string

func (Journalists) MarshalJSON

func (j Journalists) MarshalJSON() ([]byte, error)

func (*Journalists) UnmarshalJSON

func (j *Journalists) UnmarshalJSON(data []byte) error

type JournalistsVisitor

type JournalistsVisitor interface {
	VisitStringList([]string) error
	VisitString(string) error
}

type Lang added in v1.1.0

type Lang struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

The language(s) of the search. The only accepted format is the two-letter [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) code. To select multiple languages, use a comma-separated string or an array of strings.

Examples: - `"en,es"` - `["en", "es"]`

To learn more, see [Enumerated parameters > Language](/docs/v3/api-reference/overview/enumerated-parameters#language-lang-and-not-lang).

func NewLangFromString added in v1.1.0

func NewLangFromString(value string) *Lang

func NewLangFromStringList added in v1.1.0

func NewLangFromStringList(value []string) *Lang

func (*Lang) Accept added in v1.1.0

func (l *Lang) Accept(visitor LangVisitor) error

func (*Lang) GetString added in v1.1.0

func (l *Lang) GetString() string

func (*Lang) GetStringList added in v1.1.0

func (l *Lang) GetStringList() []string

func (Lang) MarshalJSON added in v1.1.0

func (l Lang) MarshalJSON() ([]byte, error)

func (*Lang) UnmarshalJSON added in v1.1.0

func (l *Lang) UnmarshalJSON(data []byte) error

type LangVisitor added in v1.1.0

type LangVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}

type LatestHeadlinesGetRequest

type LatestHeadlinesGetRequest struct {
	// The time period for which you want to get the latest headlines.
	//
	// Format examples:
	// - `7d`: Last seven days
	// - `30d`: Last 30 days
	// - `1h`: Last hour
	// - `24h`: Last 24 hours
	When *string `json:"-" url:"when,omitempty"`
	// If true, the `from_` and `to_` parameters use article parse dates instead of published dates. Additionally, the `parse_date` variable is added to the output for each article object.
	ByParseDate *bool `json:"-" url:"by_parse_date,omitempty"`
	// The language(s) of the search. The only accepted format is the two-letter [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) code. To select multiple languages, use a comma-separated string.
	//
	// Example: `"en, es"`
	//
	// To learn more, see [Enumerated parameters > Language](/docs/v3/api-reference/overview/enumerated-parameters#language-lang-and-not-lang).
	Lang *string `json:"-" url:"lang,omitempty"`
	// The language(s) to exclude from the search. The accepted format is the two-letter [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) code. To exclude multiple languages, use a comma-separated string.
	//
	// Example: `"fr, de"`
	//
	// To learn more, see [Enumerated parameters > Language](/docs/v3/api-reference/overview/enumerated-parameters#language-lang-and-not-lang).
	NotLang *string `json:"-" url:"not_lang,omitempty"`
	// The countries where the news publisher is located. The accepted format is the two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. To select multiple countries, use a comma-separated string.
	//
	// Example: `"US, CA"`
	//
	// To learn more, see [Enumerated parameters > Country](/docs/v3/api-reference/overview/enumerated-parameters#country-country-and-not-country).
	Countries *string `json:"-" url:"countries,omitempty"`
	// The publisher location countries to exclude from the search. The accepted format is the two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. To exclude multiple countries, use a comma-separated string.
	//
	// Example:`"US, CA"`
	//
	// To learn more, see [Enumerated parameters > Country](/docs/v3/api-reference/overview/enumerated-parameters#country-country-and-not-country).
	NotCountries *string `json:"-" url:"not_countries,omitempty"`
	// Predefined top news sources per country.
	//
	// Format: start with the word `top`, followed by the number of desired sources, and then the two-letter country code [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Multiple countries with the number of top sources can be specified as a comma-separated string.
	//
	// Examples:
	// - `"top 100 US"`
	// - `"top 33 AT"`
	// - `"top 50 US, top 20 GB"`
	// - `"top 33 AT, top 50 IT"`
	PredefinedSources *string `json:"-" url:"predefined_sources,omitempty"`
	// One or more news sources to narrow down the search. The format must be a domain URL. Subdomains, such as `finance.yahoo.com`, are also acceptable.To specify multiple sources, use a comma-separated string.
	//
	// Examples:
	// - `"nytimes.com"`
	// - `"theguardian.com, finance.yahoo.com"`
	Sources *string `json:"-" url:"sources,omitempty"`
	// The news sources to exclude from the search. To exclude multiple sources, use a comma-separated string.
	//
	// Example: `"cnn.com, wsj.com"`
	NotSources *string `json:"-" url:"not_sources,omitempty"`
	// The list of author names to exclude from your search. To exclude articles by specific authors, use a comma-separated string.
	//
	// Example: `"John Doe, Jane Doe"`
	NotAuthorName *string `json:"-" url:"not_author_name,omitempty"`
	// If true, limits the search to sources ranked in the top 1 million online websites. If false, includes unranked sources which are assigned a rank of 999999.
	RankedOnly *bool `json:"-" url:"ranked_only,omitempty"`
	// If true, only returns articles that were posted on the home page of a given news domain.
	IsHeadline *bool `json:"-" url:"is_headline,omitempty"`
	// If true, returns only opinion pieces. If false, excludes opinion-based articles and returns news only.
	IsOpinion *bool `json:"-" url:"is_opinion,omitempty"`
	// If false, returns only articles that have publicly available complete content. Some publishers partially block content, so this setting ensures that only full articles are retrieved.
	IsPaidContent *bool `json:"-" url:"is_paid_content,omitempty"`
	// The categorical URL(s) to filter your search. To filter your search by multiple categorical URLs, use a comma-separated string.
	//
	// Example: `"wsj.com/politics, wsj.com/tech"`
	ParentUrl *string `json:"-" url:"parent_url,omitempty"`
	// The complete URL(s) mentioned in the article. For multiple URLs, use a comma-separated string.
	//
	// Example: `"https://aiindex.stanford.edu/report, https://www.stateof.ai"`
	//
	// For more details, see [Search by URL](/docs/v3/documentation/how-to/search-by-url).
	AllLinks *string `json:"-" url:"all_links,omitempty"`
	// The domain(s) mentioned in the article. For multiple domains, use a comma-separated string.
	//
	// Example: `"who.int, nih.gov"`
	//
	// For more details, see [Search by URL](/docs/v3/documentation/how-to/search-by-url).
	AllDomainLinks *string `json:"-" url:"all_domain_links,omitempty"`
	// The minimum number of words an article must contain. To be used for avoiding articles with small content.
	WordCountMin *int `json:"-" url:"word_count_min,omitempty"`
	// The maximum number of words an article can contain. To be used for avoiding articles with large content.
	WordCountMax *int `json:"-" url:"word_count_max,omitempty"`
	// The page number to scroll through the results. Use for pagination, as a single API response can return up to 1,000 articles.
	//
	// For details, see [How to paginate large datasets](https://www.newscatcherapi.com/docs/v3/documentation/how-to/paginate-large-datasets).
	Page *int `json:"-" url:"page,omitempty"`
	// The number of articles to return per page.
	PageSize *int `json:"-" url:"page_size,omitempty"`
	// Determines whether to group similar articles into clusters. If true, the API returns clustered results.
	//
	// To learn more, see [Clustering news articles](/docs/v3/documentation/guides-and-concepts/clustering-news-articles).
	ClusteringEnabled *bool `json:"-" url:"clustering_enabled,omitempty"`
	// Specifies which part of the article to use for determining similarity when clustering.
	//
	// Possible values are:
	// - `content`: Uses the full article content (default).
	// - `title`: Uses only the article title.
	// - `summary`: Uses the article summary.
	//
	// To learn more, see [Clustering news articles](/docs/v3/documentation/guides-and-concepts/clustering-news-articles).
	ClusteringVariable *LatestHeadlinesGetRequestClusteringVariable `json:"-" url:"clustering_variable,omitempty"`
	// Sets the similarity threshold for grouping articles into clusters. A lower value creates more inclusive clusters, while a higher value requires greater similarity between articles.
	//
	// Examples:
	// - `0.3`: Results in larger, more diverse clusters.
	// - `0.6`: Balances cluster size and article similarity (default).
	// - `0.9`: Creates smaller, tightly related clusters.
	//
	// To learn more, see [Clustering news articles](/docs/v3/documentation/guides-and-concepts/clustering-news-articles).
	ClusteringThreshold *float64 `json:"-" url:"clustering_threshold,omitempty"`
	// If true, includes an NLP layer with each article in the response. This layer provides enhanced information such as theme classification, article summary, sentiment analysis, tags, and named entity recognition.
	//
	// The NLP layer includes:
	// - Theme: General topic of the article.
	// - Summary: A concise overview of the article content.
	// - Sentiment: Separate scores for title and content (range: -1 to 1).
	// - Named entities: Identified persons (PER), organizations (ORG), locations (LOC), and miscellaneous entities (MISC).
	// - IPTC tags: Standardized news category tags.
	// - IAB tags: Content categories for digital advertising.
	//
	// **Note**: The `include_nlp_data` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	IncludeNlpData *bool `json:"-" url:"include_nlp_data,omitempty"`
	// If true, filters the results to include only articles with an NLP layer. This allows you to focus on articles that have been processed with advanced NLP techniques.
	//
	// **Note**: The `has_nlp` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	HasNlp *bool `json:"-" url:"has_nlp,omitempty"`
	// Filters articles based on their general topic, as determined by NLP analysis. To select multiple themes, use a comma-separated string.
	//
	// Example: `"Finance, Tech"`
	//
	// **Note**: The `theme` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	//
	// Available options: `Business`, `Economics`, `Entertainment`, `Finance`, `Health`, `Politics`, `Science`, `Sports`, `Tech`, `Crime`, `Financial Crime`, `Lifestyle`, `Automotive`, `Travel`, `Weather`, `General`.
	Theme *string `json:"-" url:"theme,omitempty"`
	// Inverse of the `theme` parameter. Excludes articles based on their general topic, as determined by NLP analysis. To exclude multiple themes, use a comma-separated string.
	//
	// Example: `"Crime, Tech"`
	//
	// **Note**: The `not_theme` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	NotTheme *string `json:"-" url:"not_theme,omitempty"`
	// Filters articles that mention specific organization names, as identified by NLP analysis. To specify multiple organizations, use a comma-separated string.
	//
	// Example: `"Apple, Microsoft"`
	//
	// **Note**: The `ORG_entity_name` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [Search by entity](/docs/v3/documentation/how-to/search-by-entity).
	OrgEntityName *string `json:"-" url:"ORG_entity_name,omitempty"`
	// Filters articles that mention specific person names, as identified by NLP analysis. To specify multiple names, use a comma-separated string.
	//
	// Example: `"Elon Musk, Jeff Bezos"`
	//
	// **Note**: The `PER_entity_name` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [Search by entity](/docs/v3/documentation/how-to/search-by-entity).
	PerEntityName *string `json:"-" url:"PER_entity_name,omitempty"`
	// Filters articles that mention specific location names, as identified by NLP analysis. To specify multiple locations, use a comma-separated string.
	//
	// Example: `"California, New York"`
	//
	// **Note**: The `LOC_entity_name` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [Search by entity](/docs/v3/documentation/how-to/search-by-entity).
	LocEntityName *string `json:"-" url:"LOC_entity_name,omitempty"`
	// Filters articles that mention other named entities not falling under person, organization, or location categories. Includes events, nationalities, products, works of art, and more. To specify multiple entities, use a comma-separated string.
	//
	// Example: `"Bitcoin, Blockchain"`
	//
	// **Note**: The `MISC_entity_name` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [Search by entity](/docs/v3/documentation/how-to/search-by-entity).
	MiscEntityName *string `json:"-" url:"MISC_entity_name,omitempty"`
	// Filters articles based on the minimum sentiment score of their titles.
	//
	// Range is `-1.0` to `1.0`, where:
	// - Negative values indicate negative sentiment.
	// - Positive values indicate positive sentiment.
	// - Values close to 0 indicate neutral sentiment.
	//
	// **Note**: The `title_sentiment_min` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	TitleSentimentMin *float64 `json:"-" url:"title_sentiment_min,omitempty"`
	// Filters articles based on the maximum sentiment score of their titles.
	//
	// Range is `-1.0` to `1.0`, where:
	// - Negative values indicate negative sentiment.
	// - Positive values indicate positive sentiment.
	// - Values close to 0 indicate neutral sentiment.
	//
	// **Note**: The `title_sentiment_max` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	TitleSentimentMax *float64 `json:"-" url:"title_sentiment_max,omitempty"`
	// Filters articles based on the minimum sentiment score of their content.
	//
	// Range is `-1.0` to `1.0`, where:
	// - Negative values indicate negative sentiment.
	// - Positive values indicate positive sentiment.
	// - Values close to 0 indicate neutral sentiment.
	//
	// **Note**: The `content_sentiment_min` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	ContentSentimentMin *float64 `json:"-" url:"content_sentiment_min,omitempty"`
	// Filters articles based on the maximum sentiment score of their content.
	//
	// Range is `-1.0` to `1.0`, where:
	// - Negative values indicate negative sentiment.
	// - Positive values indicate positive sentiment.
	// - Values close to 0 indicate neutral sentiment.
	//
	// **Note**: The `content_sentiment_max` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	ContentSentimentMax *float64 `json:"-" url:"content_sentiment_max,omitempty"`
	// Filters articles based on International Press Telecommunications Council (IPTC) media topic tags. To specify multiple IPTC tags, use a comma-separated string of tag IDs.
	//
	// Example: `"20000199, 20000209"`
	//
	// **Note**: The `iptc_tags` parameter is only available if tags are included in your subscription plan.
	//
	// To learn more, see [IPTC Media Topic NewsCodes](https://www.iptc.org/std/NewsCodes/treeview/mediatopic/mediatopic-en-GB.html).
	IptcTags *string `json:"-" url:"iptc_tags,omitempty"`
	// Inverse of the `iptc_tags` parameter. Excludes articles based on International Press Telecommunications Council (IPTC) media topic tags. To specify multiple IPTC tags to exclude, use a comma-separated string of tag IDs.
	//
	// Example: `"20000205, 20000209"`
	//
	// **Note**: The `not_iptc_tags` parameter is only available if tags are included in your subscription plan.
	//
	// To learn more, see [IPTC Media Topic NewsCodes](https://www.iptc.org/std/NewsCodes/treeview/mediatopic/mediatopic-en-GB.html).
	NotIptcTags *string `json:"-" url:"not_iptc_tags,omitempty"`
	// Filters articles based on Interactive Advertising Bureau (IAB) content categories. These tags provide a standardized taxonomy for digital advertising content categorization. To specify multiple IAB categories, use a comma-separated string.
	//
	// Example: `"Business, Events"`
	//
	// **Note**: The `iab_tags` parameter is only available if tags are included in your subscription plan.
	//
	// To learn more, see the [IAB Content taxonomy](https://iabtechlab.com/standards/content-taxonomy/).
	IabTags *string `json:"-" url:"iab_tags,omitempty"`
	// Inverse of the `iab_tags` parameter. Excludes articles based on Interactive Advertising Bureau (IAB) content categories. These tags provide a standardized taxonomy for digital advertising content categorization. To specify multiple IAB categories to exclude, use a comma-separated string.
	//
	// Example: `"Agriculture, Metals"`
	//
	// **Note**: The `not_iab_tags` parameter is only available if tags are included in your subscription plan.
	//
	// To learn more, see the [IAB Content taxonomy](https://iabtechlab.com/standards/content-taxonomy/).
	NotIabTags *string `json:"-" url:"not_iab_tags,omitempty"`
	// Filters articles based on provided taxonomy that is tailored to your specific needs and is accessible only with your API key. To specify tags, use the following pattern:
	//
	// - `custom_tags.taxonomy=Tag1,Tag2,Tag3`, where `taxonomy` is the taxonomy name and `Tag1,Tag2,Tag3` is a comma-separated list of tags.
	//
	// Example: `custom_tags.industry="Manufacturing, Supply Chain, Logistics"`
	//
	// To learn more, see the [Custom tags](/docs/v3/documentation/guides-and-concepts/custom-tags).
	CustomTags *string `json:"-" url:"custom_tags,omitempty"`
}

type LatestHeadlinesGetRequestClusteringVariable added in v1.1.0

type LatestHeadlinesGetRequestClusteringVariable string
const (
	LatestHeadlinesGetRequestClusteringVariableContent LatestHeadlinesGetRequestClusteringVariable = "content"
	LatestHeadlinesGetRequestClusteringVariableTitle   LatestHeadlinesGetRequestClusteringVariable = "title"
	LatestHeadlinesGetRequestClusteringVariableSummary LatestHeadlinesGetRequestClusteringVariable = "summary"
)

func NewLatestHeadlinesGetRequestClusteringVariableFromString added in v1.1.0

func NewLatestHeadlinesGetRequestClusteringVariableFromString(s string) (LatestHeadlinesGetRequestClusteringVariable, error)

func (LatestHeadlinesGetRequestClusteringVariable) Ptr added in v1.1.0

type LatestHeadlinesGetResponse

type LatestHeadlinesGetResponse struct {
	SearchResponseDto          *SearchResponseDto
	ClusteredSearchResponseDto *ClusteredSearchResponseDto
	// contains filtered or unexported fields
}

func NewLatestHeadlinesGetResponseFromClusteredSearchResponseDto added in v1.1.0

func NewLatestHeadlinesGetResponseFromClusteredSearchResponseDto(value *ClusteredSearchResponseDto) *LatestHeadlinesGetResponse

func NewLatestHeadlinesGetResponseFromSearchResponseDto added in v1.1.0

func NewLatestHeadlinesGetResponseFromSearchResponseDto(value *SearchResponseDto) *LatestHeadlinesGetResponse

func (*LatestHeadlinesGetResponse) Accept

func (*LatestHeadlinesGetResponse) GetClusteredSearchResponseDto added in v1.1.0

func (l *LatestHeadlinesGetResponse) GetClusteredSearchResponseDto() *ClusteredSearchResponseDto

func (*LatestHeadlinesGetResponse) GetSearchResponseDto added in v1.1.0

func (l *LatestHeadlinesGetResponse) GetSearchResponseDto() *SearchResponseDto

func (LatestHeadlinesGetResponse) MarshalJSON

func (l LatestHeadlinesGetResponse) MarshalJSON() ([]byte, error)

func (*LatestHeadlinesGetResponse) UnmarshalJSON

func (l *LatestHeadlinesGetResponse) UnmarshalJSON(data []byte) error

type LatestHeadlinesGetResponseVisitor

type LatestHeadlinesGetResponseVisitor interface {
	VisitSearchResponseDto(*SearchResponseDto) error
	VisitClusteredSearchResponseDto(*ClusteredSearchResponseDto) error
}

type LatestHeadlinesPostRequest added in v1.1.0

type LatestHeadlinesPostRequest struct {
	When                *When                `json:"when,omitempty" url:"-"`
	ByParseDate         *ByParseDate         `json:"by_parse_date,omitempty" url:"-"`
	Lang                *Lang                `json:"lang,omitempty" url:"-"`
	NotLang             *NotLang             `json:"not_lang,omitempty" url:"-"`
	Countries           *Countries           `json:"countries,omitempty" url:"-"`
	NotCountries        *NotCountries        `json:"not_countries,omitempty" url:"-"`
	PredefinedSources   *PredefinedSources   `json:"predefined_sources,omitempty" url:"-"`
	Sources             *Sources             `json:"sources,omitempty" url:"-"`
	NotSources          *NotSources          `json:"not_sources,omitempty" url:"-"`
	NotAuthorName       *NotAuthorName       `json:"not_author_name,omitempty" url:"-"`
	RankedOnly          *RankedOnly          `json:"ranked_only,omitempty" url:"-"`
	IsHeadline          *IsHeadline          `json:"is_headline,omitempty" url:"-"`
	IsOpinion           *IsOpinion           `json:"is_opinion,omitempty" url:"-"`
	IsPaidContent       *IsPaidContent       `json:"is_paid_content,omitempty" url:"-"`
	ParentUrl           *ParentUrl           `json:"parent_url,omitempty" url:"-"`
	AllLinks            *AllLinks            `json:"all_links,omitempty" url:"-"`
	AllDomainLinks      *AllDomainLinks      `json:"all_domain_links,omitempty" url:"-"`
	WordCountMin        *WordCountMin        `json:"word_count_min,omitempty" url:"-"`
	WordCountMax        *WordCountMax        `json:"word_count_max,omitempty" url:"-"`
	Page                *Page                `json:"page,omitempty" url:"-"`
	PageSize            *PageSize            `json:"page_size,omitempty" url:"-"`
	ClusteringEnabled   *ClusteringEnabled   `json:"clustering_enabled,omitempty" url:"-"`
	ClusteringVariable  *ClusteringVariable  `json:"clustering_variable,omitempty" url:"-"`
	ClusteringThreshold *ClusteringThreshold `json:"clustering_threshold,omitempty" url:"-"`
	IncludeNlpData      *IncludeNlpData      `json:"include_nlp_data,omitempty" url:"-"`
	HasNlp              *HasNlp              `json:"has_nlp,omitempty" url:"-"`
	Theme               *Theme               `json:"theme,omitempty" url:"-"`
	NotTheme            *NotTheme            `json:"not_theme,omitempty" url:"-"`
	OrgEntityName       *OrgEntityName       `json:"ORG_entity_name,omitempty" url:"-"`
	PerEntityName       *PerEntityName       `json:"PER_entity_name,omitempty" url:"-"`
	LocEntityName       *LocEntityName       `json:"LOC_entity_name,omitempty" url:"-"`
	MiscEntityName      *MiscEntityName      `json:"MISC_entity_name,omitempty" url:"-"`
	TitleSentimentMin   *TitleSentimentMin   `json:"title_sentiment_min,omitempty" url:"-"`
	TitleSentimentMax   *TitleSentimentMax   `json:"title_sentiment_max,omitempty" url:"-"`
	ContentSentimentMin *ContentSentimentMin `json:"content_sentiment_min,omitempty" url:"-"`
	ContentSentimentMax *ContentSentimentMax `json:"content_sentiment_max,omitempty" url:"-"`
	IptcTags            *IptcTags            `json:"iptc_tags,omitempty" url:"-"`
	NotIptcTags         *NotIptcTags         `json:"not_iptc_tags,omitempty" url:"-"`
	IabTags             *IabTags             `json:"iab_tags,omitempty" url:"-"`
	NotIabTags          *NotIabTags          `json:"not_iab_tags,omitempty" url:"-"`
	CustomTags          *CustomTags          `json:"custom_tags,omitempty" url:"-"`
}

type LatestHeadlinesPostResponse

type LatestHeadlinesPostResponse struct {
	SearchResponseDto          *SearchResponseDto
	ClusteredSearchResponseDto *ClusteredSearchResponseDto
	// contains filtered or unexported fields
}

func NewLatestHeadlinesPostResponseFromClusteredSearchResponseDto added in v1.1.0

func NewLatestHeadlinesPostResponseFromClusteredSearchResponseDto(value *ClusteredSearchResponseDto) *LatestHeadlinesPostResponse

func NewLatestHeadlinesPostResponseFromSearchResponseDto added in v1.1.0

func NewLatestHeadlinesPostResponseFromSearchResponseDto(value *SearchResponseDto) *LatestHeadlinesPostResponse

func (*LatestHeadlinesPostResponse) Accept

func (*LatestHeadlinesPostResponse) GetClusteredSearchResponseDto added in v1.1.0

func (l *LatestHeadlinesPostResponse) GetClusteredSearchResponseDto() *ClusteredSearchResponseDto

func (*LatestHeadlinesPostResponse) GetSearchResponseDto added in v1.1.0

func (l *LatestHeadlinesPostResponse) GetSearchResponseDto() *SearchResponseDto

func (LatestHeadlinesPostResponse) MarshalJSON

func (l LatestHeadlinesPostResponse) MarshalJSON() ([]byte, error)

func (*LatestHeadlinesPostResponse) UnmarshalJSON

func (l *LatestHeadlinesPostResponse) UnmarshalJSON(data []byte) error

type LatestHeadlinesPostResponseVisitor

type LatestHeadlinesPostResponseVisitor interface {
	VisitSearchResponseDto(*SearchResponseDto) error
	VisitClusteredSearchResponseDto(*ClusteredSearchResponseDto) error
}
type Links struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

The article link or list of article links to search for. To specify multiple links, use a comma-separated string or an array of strings.

Examples: - `"https://nytimes.com/article1, https://bbc.com/article2"` - `["https://nytimes.com/article1", "https://bbc.com/article2"]`

**Caution**: You can use either the `links` or the `ids` parameter, but not both at the same time.

func NewLinksFromString added in v1.1.0

func NewLinksFromString(value string) *Links

func NewLinksFromStringList added in v1.1.0

func NewLinksFromStringList(value []string) *Links

func (*Links) Accept added in v1.1.0

func (l *Links) Accept(visitor LinksVisitor) error

func (*Links) GetString added in v1.1.0

func (l *Links) GetString() string

func (*Links) GetStringList added in v1.1.0

func (l *Links) GetStringList() []string

func (Links) MarshalJSON added in v1.1.0

func (l Links) MarshalJSON() ([]byte, error)

func (*Links) UnmarshalJSON added in v1.1.0

func (l *Links) UnmarshalJSON(data []byte) error

type LinksVisitor added in v1.1.0

type LinksVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}

type LocEntityName added in v1.1.0

type LocEntityName struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

Filters articles that mention specific location names, as identified by NLP analysis. To specify multiple locations, use a comma-separated string or an array of strings.

Examples: - `"California, New York"` - `["California", "New York"]`

**Note**: The `LOC_entity_name` parameter is only available if NLP is included in your subscription plan.

To learn more, see [Search by entity](/docs/v3/documentation/how-to/search-by-entity).

func NewLocEntityNameFromString added in v1.1.0

func NewLocEntityNameFromString(value string) *LocEntityName

func NewLocEntityNameFromStringList added in v1.1.0

func NewLocEntityNameFromStringList(value []string) *LocEntityName

func (*LocEntityName) Accept added in v1.1.0

func (l *LocEntityName) Accept(visitor LocEntityNameVisitor) error

func (*LocEntityName) GetString added in v1.1.0

func (l *LocEntityName) GetString() string

func (*LocEntityName) GetStringList added in v1.1.0

func (l *LocEntityName) GetStringList() []string

func (LocEntityName) MarshalJSON added in v1.1.0

func (l LocEntityName) MarshalJSON() ([]byte, error)

func (*LocEntityName) UnmarshalJSON added in v1.1.0

func (l *LocEntityName) UnmarshalJSON(data []byte) error

type LocEntityNameVisitor added in v1.1.0

type LocEntityNameVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}

type MiscEntityName added in v1.1.0

type MiscEntityName struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

Filters articles that mention other named entities not falling under person, organization, or location categories. Includes events, nationalities, products, works of art, and more. To specify multiple entities, use a comma-separated string or an array of strings.

Examples: - `"Bitcoin, Blockchain"` - `["Bitcoin", "Blockchain"]`

**Note**: The `MISC_entity_name` parameter is only available if NLP is included in your subscription plan.

To learn more, see [Search by entity](/docs/v3/documentation/how-to/search-by-entity).

func NewMiscEntityNameFromString added in v1.1.0

func NewMiscEntityNameFromString(value string) *MiscEntityName

func NewMiscEntityNameFromStringList added in v1.1.0

func NewMiscEntityNameFromStringList(value []string) *MiscEntityName

func (*MiscEntityName) Accept added in v1.1.0

func (m *MiscEntityName) Accept(visitor MiscEntityNameVisitor) error

func (*MiscEntityName) GetString added in v1.1.0

func (m *MiscEntityName) GetString() string

func (*MiscEntityName) GetStringList added in v1.1.0

func (m *MiscEntityName) GetStringList() []string

func (MiscEntityName) MarshalJSON added in v1.1.0

func (m MiscEntityName) MarshalJSON() ([]byte, error)

func (*MiscEntityName) UnmarshalJSON added in v1.1.0

func (m *MiscEntityName) UnmarshalJSON(data []byte) error

type MiscEntityNameVisitor added in v1.1.0

type MiscEntityNameVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}

type NamedEntityList added in v1.1.0

type NamedEntityList = []*NamedEntityListItem

A list of named entities identified in the article.

type NamedEntityListItem added in v1.1.0

type NamedEntityListItem struct {
	// The name of the entity identified in the article.
	EntityName *string `json:"entity_name,omitempty" url:"entity_name,omitempty"`
	// The number of times this entity appears in the article.
	Count *int `json:"count,omitempty" url:"count,omitempty"`
	// contains filtered or unexported fields
}

func (*NamedEntityListItem) GetCount added in v1.1.0

func (n *NamedEntityListItem) GetCount() *int

func (*NamedEntityListItem) GetEntityName added in v1.1.0

func (n *NamedEntityListItem) GetEntityName() *string

func (*NamedEntityListItem) GetExtraProperties added in v1.1.0

func (n *NamedEntityListItem) GetExtraProperties() map[string]interface{}

func (*NamedEntityListItem) String added in v1.1.0

func (n *NamedEntityListItem) String() string

func (*NamedEntityListItem) UnmarshalJSON added in v1.1.0

func (n *NamedEntityListItem) UnmarshalJSON(data []byte) error

type NerName added in v1.1.0

type NerName = string

The name of person, organization, location, product or other named entity to search for. To specify multiple names use a comma-separated string.

Example: `"Tesla, Amazon"`

type NewsDomainType added in v1.1.0

type NewsDomainType string

Filters results based on the news domain type. Possible values are: - `Original Content`: Sources that produce their own content. - `Aggregator`: Sources that collect content from various other sources. - `Press Releases`: Sources primarily publishing press releases. - `Republisher`: Sources that republish content from other sources. - `Other`: Sources that don't fit into main categories.

const (
	NewsDomainTypeOriginalContent NewsDomainType = "Original Content"
	NewsDomainTypeAggregator      NewsDomainType = "Aggregator"
	NewsDomainTypePressReleases   NewsDomainType = "Press Releases"
	NewsDomainTypeRepublisher     NewsDomainType = "Republisher"
	NewsDomainTypeOther           NewsDomainType = "Other"
)

func NewNewsDomainTypeFromString added in v1.1.0

func NewNewsDomainTypeFromString(s string) (NewsDomainType, error)

func (NewsDomainType) Ptr added in v1.1.0

func (n NewsDomainType) Ptr() *NewsDomainType

type NewsType added in v1.1.0

type NewsType struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

Filters results based on the news type. Multiple types can be specified using a comma-separated string or an array of strings.

Examples: - `"General News Outlets,Tech News and Updates"` - `["General News Outlets", "Tech News and Updates"]`

For a complete list of available news types, see [Enumerated parameters > News type](/docs/v3/api-reference/overview/enumerated-parameters#news-type-news-type).

func NewNewsTypeFromString added in v1.1.0

func NewNewsTypeFromString(value string) *NewsType

func NewNewsTypeFromStringList added in v1.1.0

func NewNewsTypeFromStringList(value []string) *NewsType

func (*NewsType) Accept added in v1.1.0

func (n *NewsType) Accept(visitor NewsTypeVisitor) error

func (*NewsType) GetString added in v1.1.0

func (n *NewsType) GetString() string

func (*NewsType) GetStringList added in v1.1.0

func (n *NewsType) GetStringList() []string

func (NewsType) MarshalJSON added in v1.1.0

func (n NewsType) MarshalJSON() ([]byte, error)

func (*NewsType) UnmarshalJSON added in v1.1.0

func (n *NewsType) UnmarshalJSON(data []byte) error

type NewsTypeVisitor added in v1.1.0

type NewsTypeVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}

type NlpDataEntity added in v1.1.0

type NlpDataEntity struct {
	// The themes or categories identified in the article.
	Theme *string `json:"theme,omitempty" url:"theme,omitempty"`
	// A brief AI-generated summary of the article content.
	Summary   *string          `json:"summary,omitempty" url:"summary,omitempty"`
	Sentiment *SentimentScores `json:"sentiment,omitempty" url:"sentiment,omitempty"`
	// A dense 1024-dimensional vector representation of the article content, generated using  the [multilingual-e5-large](https://huggingface.co/intfloat/multilingual-e5-large) model.
	//
	// **Note**: The `new_embedding` field is only available in the `v3_local_news_nlp_embeddings` subscription plan.
	NewEmbedding []float64 `json:"new_embedding,omitempty" url:"new_embedding,omitempty"`
	// Named Entity Recognition for person entities (individuals' names).
	NerPer *NamedEntityList `json:"ner_PER,omitempty" url:"ner_PER,omitempty"`
	// Named Entity Recognition for organization entities (company names, institutions).
	NerOrg *NamedEntityList `json:"ner_ORG,omitempty" url:"ner_ORG,omitempty"`
	// Named Entity Recognition for miscellaneous entities (events, nationalities, products).
	NerMisc *NamedEntityList `json:"ner_MISC,omitempty" url:"ner_MISC,omitempty"`
	// Named Entity Recognition for location entities (cities, countries, geographic features).
	NerLoc *NamedEntityList `json:"ner_LOC,omitempty" url:"ner_LOC,omitempty"`
	// IPTC media topic taxonomy paths identified in the article content. Each path represents a hierarchical category following the IPTC standard.
	IptcTagsName []string `json:"iptc_tags_name,omitempty" url:"iptc_tags_name,omitempty"`
	// IPTC media topic numeric codes identified in the article content. These codes correspond to the standardized IPTC media topic taxonomy.
	IptcTagsId []string `json:"iptc_tags_id,omitempty" url:"iptc_tags_id,omitempty"`
	// IAB content taxonomy paths identified in the article content. Each path represents a hierarchical category following the IAB content standard.
	IabTagsName []string `json:"iab_tags_name,omitempty" url:"iab_tags_name,omitempty"`
	// contains filtered or unexported fields
}

Natural Language Processing data for the article.

func (*NlpDataEntity) GetExtraProperties added in v1.1.0

func (n *NlpDataEntity) GetExtraProperties() map[string]interface{}

func (*NlpDataEntity) GetIabTagsName added in v1.1.0

func (n *NlpDataEntity) GetIabTagsName() []string

func (*NlpDataEntity) GetIptcTagsId added in v1.1.0

func (n *NlpDataEntity) GetIptcTagsId() []string

func (*NlpDataEntity) GetIptcTagsName added in v1.1.0

func (n *NlpDataEntity) GetIptcTagsName() []string

func (*NlpDataEntity) GetNerLoc added in v1.1.0

func (n *NlpDataEntity) GetNerLoc() *NamedEntityList

func (*NlpDataEntity) GetNerMisc added in v1.1.0

func (n *NlpDataEntity) GetNerMisc() *NamedEntityList

func (*NlpDataEntity) GetNerOrg added in v1.1.0

func (n *NlpDataEntity) GetNerOrg() *NamedEntityList

func (*NlpDataEntity) GetNerPer added in v1.1.0

func (n *NlpDataEntity) GetNerPer() *NamedEntityList

func (*NlpDataEntity) GetNewEmbedding added in v1.1.0

func (n *NlpDataEntity) GetNewEmbedding() []float64

func (*NlpDataEntity) GetSentiment added in v1.1.0

func (n *NlpDataEntity) GetSentiment() *SentimentScores

func (*NlpDataEntity) GetSummary added in v1.1.0

func (n *NlpDataEntity) GetSummary() *string

func (*NlpDataEntity) GetTheme added in v1.1.0

func (n *NlpDataEntity) GetTheme() *string

func (*NlpDataEntity) String added in v1.1.0

func (n *NlpDataEntity) String() string

func (*NlpDataEntity) UnmarshalJSON added in v1.1.0

func (n *NlpDataEntity) UnmarshalJSON(data []byte) error

type NotAuthorName added in v1.1.0

type NotAuthorName struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

The list of author names to exclude from your search. To exclude articles by specific authors, use a comma-separated string or an array of strings.

Examples: - `"John Doe, Jane Doe"` - `["John Doe", "Jane Doe"]`

func NewNotAuthorNameFromString added in v1.1.0

func NewNotAuthorNameFromString(value string) *NotAuthorName

func NewNotAuthorNameFromStringList added in v1.1.0

func NewNotAuthorNameFromStringList(value []string) *NotAuthorName

func (*NotAuthorName) Accept added in v1.1.0

func (n *NotAuthorName) Accept(visitor NotAuthorNameVisitor) error

func (*NotAuthorName) GetString added in v1.1.0

func (n *NotAuthorName) GetString() string

func (*NotAuthorName) GetStringList added in v1.1.0

func (n *NotAuthorName) GetStringList() []string

func (NotAuthorName) MarshalJSON added in v1.1.0

func (n NotAuthorName) MarshalJSON() ([]byte, error)

func (*NotAuthorName) UnmarshalJSON added in v1.1.0

func (n *NotAuthorName) UnmarshalJSON(data []byte) error

type NotAuthorNameVisitor added in v1.1.0

type NotAuthorNameVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}

type NotCountries added in v1.1.0

type NotCountries struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

The publisher location countries to exclude from the search. The accepted format is the two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. To exclude multiple countries, use a comma-separated string or an array of strings.

Examples: - `"UK,FR"` - `["UK", "FR"]`

To learn more, see [Enumerated parameters > Country](/docs/v3/api-reference/overview/enumerated-parameters#country-country-and-not-country).

func NewNotCountriesFromString added in v1.1.0

func NewNotCountriesFromString(value string) *NotCountries

func NewNotCountriesFromStringList added in v1.1.0

func NewNotCountriesFromStringList(value []string) *NotCountries

func (*NotCountries) Accept added in v1.1.0

func (n *NotCountries) Accept(visitor NotCountriesVisitor) error

func (*NotCountries) GetString added in v1.1.0

func (n *NotCountries) GetString() string

func (*NotCountries) GetStringList added in v1.1.0

func (n *NotCountries) GetStringList() []string

func (NotCountries) MarshalJSON added in v1.1.0

func (n NotCountries) MarshalJSON() ([]byte, error)

func (*NotCountries) UnmarshalJSON added in v1.1.0

func (n *NotCountries) UnmarshalJSON(data []byte) error

type NotCountriesVisitor added in v1.1.0

type NotCountriesVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}

type NotIabTags added in v1.1.0

type NotIabTags struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

Inverse of the `iab_tags` parameter. Excludes articles based on Interactive Advertising Bureau (IAB) content categories. These tags provide a standardized taxonomy for digital advertising content categorization. To specify multiple IAB categories to exclude, use a comma-separated string or an array of strings.

Examples: - `"Agriculture, Metals"` - `["Agriculture", "Metals"]`

**Note**: The `not_iab_tags` parameter is only available if tags are included in your subscription plan.

To learn more, see the [IAB Content taxonomy](https://iabtechlab.com/standards/content-taxonomy/).

func NewNotIabTagsFromString added in v1.1.0

func NewNotIabTagsFromString(value string) *NotIabTags

func NewNotIabTagsFromStringList added in v1.1.0

func NewNotIabTagsFromStringList(value []string) *NotIabTags

func (*NotIabTags) Accept added in v1.1.0

func (n *NotIabTags) Accept(visitor NotIabTagsVisitor) error

func (*NotIabTags) GetString added in v1.1.0

func (n *NotIabTags) GetString() string

func (*NotIabTags) GetStringList added in v1.1.0

func (n *NotIabTags) GetStringList() []string

func (NotIabTags) MarshalJSON added in v1.1.0

func (n NotIabTags) MarshalJSON() ([]byte, error)

func (*NotIabTags) UnmarshalJSON added in v1.1.0

func (n *NotIabTags) UnmarshalJSON(data []byte) error

type NotIabTagsVisitor added in v1.1.0

type NotIabTagsVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}

type NotIptcTags added in v1.1.0

type NotIptcTags struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

Inverse of the `iptc_tags` parameter. Excludes articles based on International Press Telecommunications Council (IPTC) media topic tags. To specify multiple IPTC tags to exclude, use a comma-separated string or an array of strings.

Examples: - `"20000205, 20000209"` - `["20000205", "20000209"]`

**Note**: The `not_iptc_tags` parameter is only available if tags are included in your subscription plan.

To learn more, see [IPTC Media Topic NewsCodes](https://www.iptc.org/std/NewsCodes/treeview/mediatopic/mediatopic-en-GB.html).

func NewNotIptcTagsFromString added in v1.1.0

func NewNotIptcTagsFromString(value string) *NotIptcTags

func NewNotIptcTagsFromStringList added in v1.1.0

func NewNotIptcTagsFromStringList(value []string) *NotIptcTags

func (*NotIptcTags) Accept added in v1.1.0

func (n *NotIptcTags) Accept(visitor NotIptcTagsVisitor) error

func (*NotIptcTags) GetString added in v1.1.0

func (n *NotIptcTags) GetString() string

func (*NotIptcTags) GetStringList added in v1.1.0

func (n *NotIptcTags) GetStringList() []string

func (NotIptcTags) MarshalJSON added in v1.1.0

func (n NotIptcTags) MarshalJSON() ([]byte, error)

func (*NotIptcTags) UnmarshalJSON added in v1.1.0

func (n *NotIptcTags) UnmarshalJSON(data []byte) error

type NotIptcTagsVisitor added in v1.1.0

type NotIptcTagsVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}

type NotLang added in v1.1.0

type NotLang struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

The language(s) to exclude from the search. The accepted format is the two-letter [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) code. To exclude multiple languages, use a comma-separated string or an array of strings.

Examples: - `"fr,de"` - `["fr", "de"]`

To learn more, see [Enumerated parameters > Language](/docs/v3/api-reference/overview/enumerated-parameters#language-lang-and-not-lang).

func NewNotLangFromString added in v1.1.0

func NewNotLangFromString(value string) *NotLang

func NewNotLangFromStringList added in v1.1.0

func NewNotLangFromStringList(value []string) *NotLang

func (*NotLang) Accept added in v1.1.0

func (n *NotLang) Accept(visitor NotLangVisitor) error

func (*NotLang) GetString added in v1.1.0

func (n *NotLang) GetString() string

func (*NotLang) GetStringList added in v1.1.0

func (n *NotLang) GetStringList() []string

func (NotLang) MarshalJSON added in v1.1.0

func (n NotLang) MarshalJSON() ([]byte, error)

func (*NotLang) UnmarshalJSON added in v1.1.0

func (n *NotLang) UnmarshalJSON(data []byte) error

type NotLangVisitor added in v1.1.0

type NotLangVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}

type NotSources added in v1.1.0

type NotSources struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

The news sources to exclude from the search. To exclude multiple sources, use a comma-separated string or an array of strings.

Examples: - `"cnn.com, wsj.com"` - `["cnn.com", "wsj.com"]`

func NewNotSourcesFromString added in v1.1.0

func NewNotSourcesFromString(value string) *NotSources

func NewNotSourcesFromStringList added in v1.1.0

func NewNotSourcesFromStringList(value []string) *NotSources

func (*NotSources) Accept added in v1.1.0

func (n *NotSources) Accept(visitor NotSourcesVisitor) error

func (*NotSources) GetString added in v1.1.0

func (n *NotSources) GetString() string

func (*NotSources) GetStringList added in v1.1.0

func (n *NotSources) GetStringList() []string

func (NotSources) MarshalJSON added in v1.1.0

func (n NotSources) MarshalJSON() ([]byte, error)

func (*NotSources) UnmarshalJSON added in v1.1.0

func (n *NotSources) UnmarshalJSON(data []byte) error

type NotSourcesVisitor added in v1.1.0

type NotSourcesVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}

type NotTheme added in v1.1.0

type NotTheme struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

Inverse of the `theme` parameter. Excludes articles based on their general topic, as determined by NLP analysis. To exclude multiple themes, use a comma-separated string or an array of strings.

Examples: - `"Crime, Tech"` - `["Crime", "Tech"]`

**Note**: The `not_theme` parameter is only available if NLP is included in your subscription plan.

To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).

func NewNotThemeFromString added in v1.1.0

func NewNotThemeFromString(value string) *NotTheme

func NewNotThemeFromStringList added in v1.1.0

func NewNotThemeFromStringList(value []string) *NotTheme

func (*NotTheme) Accept added in v1.1.0

func (n *NotTheme) Accept(visitor NotThemeVisitor) error

func (*NotTheme) GetString added in v1.1.0

func (n *NotTheme) GetString() string

func (*NotTheme) GetStringList added in v1.1.0

func (n *NotTheme) GetStringList() []string

func (NotTheme) MarshalJSON added in v1.1.0

func (n NotTheme) MarshalJSON() ([]byte, error)

func (*NotTheme) UnmarshalJSON added in v1.1.0

func (n *NotTheme) UnmarshalJSON(data []byte) error

type NotThemeVisitor added in v1.1.0

type NotThemeVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}

type OrgEntityName added in v1.1.0

type OrgEntityName struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

Filters articles that mention specific organization names, as identified by NLP analysis. To specify multiple organizations, use a comma-separated string or an array of strings.

Examples: - `"Apple, Microsoft"` - `["Apple", "Microsoft"]`

**Note**: The `ORG_entity_name` parameter is only available if NLP is included in your subscription plan.

To learn more, see [Search by entity](/docs/v3/documentation/how-to/search-by-entity).

func NewOrgEntityNameFromString added in v1.1.0

func NewOrgEntityNameFromString(value string) *OrgEntityName

func NewOrgEntityNameFromStringList added in v1.1.0

func NewOrgEntityNameFromStringList(value []string) *OrgEntityName

func (*OrgEntityName) Accept added in v1.1.0

func (o *OrgEntityName) Accept(visitor OrgEntityNameVisitor) error

func (*OrgEntityName) GetString added in v1.1.0

func (o *OrgEntityName) GetString() string

func (*OrgEntityName) GetStringList added in v1.1.0

func (o *OrgEntityName) GetStringList() []string

func (OrgEntityName) MarshalJSON added in v1.1.0

func (o OrgEntityName) MarshalJSON() ([]byte, error)

func (*OrgEntityName) UnmarshalJSON added in v1.1.0

func (o *OrgEntityName) UnmarshalJSON(data []byte) error

type OrgEntityNameVisitor added in v1.1.0

type OrgEntityNameVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}

type Page added in v1.1.0

type Page = int

The page number to scroll through the results. Use for pagination, as a single API response can return up to 1,000 articles.

For details, see [How to paginate large datasets](https://www.newscatcherapi.com/docs/v3/documentation/how-to/paginate-large-datasets).

type PageSize added in v1.1.0

type PageSize = int

The number of articles to return per page.

type ParentUrl added in v1.1.0

type ParentUrl struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

The categorical URL(s) to filter your search. To filter your search by multiple categorical URLs, use a comma-separated string or an array of strings.

Examples: - `"wsj.com/politics,wsj.com/tech"` - `["wsj.com/politics", "wsj.com/tech"]`

func NewParentUrlFromString added in v1.1.0

func NewParentUrlFromString(value string) *ParentUrl

func NewParentUrlFromStringList added in v1.1.0

func NewParentUrlFromStringList(value []string) *ParentUrl

func (*ParentUrl) Accept added in v1.1.0

func (p *ParentUrl) Accept(visitor ParentUrlVisitor) error

func (*ParentUrl) GetString added in v1.1.0

func (p *ParentUrl) GetString() string

func (*ParentUrl) GetStringList added in v1.1.0

func (p *ParentUrl) GetStringList() []string

func (ParentUrl) MarshalJSON added in v1.1.0

func (p ParentUrl) MarshalJSON() ([]byte, error)

func (*ParentUrl) UnmarshalJSON added in v1.1.0

func (p *ParentUrl) UnmarshalJSON(data []byte) error

type ParentUrlVisitor added in v1.1.0

type ParentUrlVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}

type PerEntityName added in v1.1.0

type PerEntityName struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

Filters articles that mention specific person names, as identified by NLP analysis. To specify multiple names, use a comma-separated string or an array of strings.

Examples: - `"Elon Musk, Jeff Bezos"` - `["Elon Musk", "Jeff Bezos"]`

**Note**: The `PER_entity_name` parameter is only available if NLP is included in your subscription plan.

To learn more, see [Search by entity](/docs/v3/documentation/how-to/search-by-entity).

func NewPerEntityNameFromString added in v1.1.0

func NewPerEntityNameFromString(value string) *PerEntityName

func NewPerEntityNameFromStringList added in v1.1.0

func NewPerEntityNameFromStringList(value []string) *PerEntityName

func (*PerEntityName) Accept added in v1.1.0

func (p *PerEntityName) Accept(visitor PerEntityNameVisitor) error

func (*PerEntityName) GetString added in v1.1.0

func (p *PerEntityName) GetString() string

func (*PerEntityName) GetStringList added in v1.1.0

func (p *PerEntityName) GetStringList() []string

func (PerEntityName) MarshalJSON added in v1.1.0

func (p PerEntityName) MarshalJSON() ([]byte, error)

func (*PerEntityName) UnmarshalJSON added in v1.1.0

func (p *PerEntityName) UnmarshalJSON(data []byte) error

type PerEntityNameVisitor added in v1.1.0

type PerEntityNameVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}

type PredefinedSources added in v1.1.0

type PredefinedSources struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

Predefined top news sources per country.

Format: start with the word `top`, followed by the number of desired sources, and then the two-letter country code [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Multiple countries with the number of top sources can be specified as a comma-separated string or an array of strings.

Examples: - `"top 100 US"` - `"top 33 AT"` - `"top 50 US, top 20 GB"` - `["top 50 US", "top 20 GB"]`

func NewPredefinedSourcesFromString added in v1.1.0

func NewPredefinedSourcesFromString(value string) *PredefinedSources

func NewPredefinedSourcesFromStringList added in v1.1.0

func NewPredefinedSourcesFromStringList(value []string) *PredefinedSources

func (*PredefinedSources) Accept added in v1.1.0

func (*PredefinedSources) GetString added in v1.1.0

func (p *PredefinedSources) GetString() string

func (*PredefinedSources) GetStringList added in v1.1.0

func (p *PredefinedSources) GetStringList() []string

func (PredefinedSources) MarshalJSON added in v1.1.0

func (p PredefinedSources) MarshalJSON() ([]byte, error)

func (*PredefinedSources) UnmarshalJSON added in v1.1.0

func (p *PredefinedSources) UnmarshalJSON(data []byte) error

type PredefinedSourcesVisitor added in v1.1.0

type PredefinedSourcesVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}

type PublishedDatePrecision added in v1.1.0

type PublishedDatePrecision string

The precision of the published date. There are three types: - `full`: The day and time of an article is correctly identified with the appropriate timezone. - `timezone unknown`: The day and time of an article is correctly identified without timezone. - `date`: Only the day is identified without an exact time.

const (
	PublishedDatePrecisionFull            PublishedDatePrecision = "full"
	PublishedDatePrecisionTimezoneUnknown PublishedDatePrecision = "timezone unknown"
	PublishedDatePrecisionDate            PublishedDatePrecision = "date"
)

func NewPublishedDatePrecisionFromString added in v1.1.0

func NewPublishedDatePrecisionFromString(s string) (PublishedDatePrecision, error)

func (PublishedDatePrecision) Ptr added in v1.1.0

type Q added in v1.1.0

type Q = string

The keyword(s) to search for in articles. Query syntax supports logical operators (`AND`, `OR`, `NOT`) and wildcards:

- For an exact match, use double quotes. For example, `"technology news"`. - Use `*` to search for any keyword. - Use `+` to include and `-` to exclude specific words or phrases. For example, `+Apple`, `-Google`. - Use `AND`, `OR`, and `NOT` to refine search results. For example, `technology AND (Apple OR Microsoft) NOT Google`.

For more details, see [Advanced querying](/docs/v3/documentation/guides-and-concepts/advanced-querying).

type RankedOnly added in v1.1.0

type RankedOnly = bool

If true, limits the search to sources ranked in the top 1 million online websites. If false, includes unranked sources which are assigned a rank of 999999.

type RequestTimeoutError added in v1.1.0

type RequestTimeoutError struct {
	*core.APIError
	Body *Error
}

Request timeout

func (*RequestTimeoutError) MarshalJSON added in v1.1.0

func (r *RequestTimeoutError) MarshalJSON() ([]byte, error)

func (*RequestTimeoutError) UnmarshalJSON added in v1.1.0

func (r *RequestTimeoutError) UnmarshalJSON(data []byte) error

func (*RequestTimeoutError) Unwrap added in v1.1.0

func (r *RequestTimeoutError) Unwrap() error

type SearchGetRequest

type SearchGetRequest struct {
	// The keyword(s) to search for in articles. Query syntax supports logical operators (`AND`, `OR`, `NOT`) and wildcards:
	//
	//   - For an exact match, use double quotes. For example, `"technology news"`.
	//   - Use `*` to search for any keyword.
	//   - Use `+` to include and `-` to exclude specific words or phrases.
	//     For example, `+Apple`, `-Google`.
	//   - Use `AND`, `OR`, and `NOT` to refine search results.
	//     For example, `technology AND (Apple OR Microsoft) NOT Google`.
	//
	// For more details, see [Advanced querying](/docs/v3/documentation/guides-and-concepts/advanced-querying).
	Q string `json:"-" url:"q"`
	// The article fields to search in. To search in multiple fields, use a comma-separated string.
	//
	// Example: `"title, summary"`
	//
	// **Note**: The `summary` option is available if NLP is enabled in your plan.
	//
	// Available options: `title`, `summary`, `content`.
	SearchIn *string `json:"-" url:"search_in,omitempty"`
	// Predefined top news sources per country.
	//
	// Format: start with the word `top`, followed by the number of desired sources, and then the two-letter country code [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Multiple countries with the number of top sources can be specified as a comma-separated string.
	//
	// Examples:
	// - `"top 100 US"`
	// - `"top 33 AT"`
	// - `"top 50 US, top 20 GB"`
	// - `"top 33 AT, top 50 IT"`
	PredefinedSources *string `json:"-" url:"predefined_sources,omitempty"`
	// Word or phrase to search within the source names. To specify multiple values, use a comma-separated string.
	//
	// Example: `"sport, tech"`
	//
	// **Note**: The search doesn't require an exact match and returns sources containing the specified terms in their names. You can use any word or phrase, like `"sport"` or `"new york times"`. For example, `"sport"` returns sources such as `"Motorsport"`, `"Dot Esport"`, and `"Tuttosport"`.
	SourceName *string `json:"-" url:"source_name,omitempty"`
	// One or more news sources to narrow down the search. The format must be a domain URL. Subdomains, such as `finance.yahoo.com`, are also acceptable.To specify multiple sources, use a comma-separated string.
	//
	// Examples:
	// - `"nytimes.com"`
	// - `"theguardian.com, finance.yahoo.com"`
	Sources *string `json:"-" url:"sources,omitempty"`
	// The news sources to exclude from the search. To exclude multiple sources, use a comma-separated string.
	//
	// Example: `"cnn.com, wsj.com"`
	NotSources *string `json:"-" url:"not_sources,omitempty"`
	// The language(s) of the search. The only accepted format is the two-letter [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) code. To select multiple languages, use a comma-separated string.
	//
	// Example: `"en, es"`
	//
	// To learn more, see [Enumerated parameters > Language](/docs/v3/api-reference/overview/enumerated-parameters#language-lang-and-not-lang).
	Lang *string `json:"-" url:"lang,omitempty"`
	// The language(s) to exclude from the search. The accepted format is the two-letter [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) code. To exclude multiple languages, use a comma-separated string.
	//
	// Example: `"fr, de"`
	//
	// To learn more, see [Enumerated parameters > Language](/docs/v3/api-reference/overview/enumerated-parameters#language-lang-and-not-lang).
	NotLang *string `json:"-" url:"not_lang,omitempty"`
	// The countries where the news publisher is located. The accepted format is the two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. To select multiple countries, use a comma-separated string.
	//
	// Example: `"US, CA"`
	//
	// To learn more, see [Enumerated parameters > Country](/docs/v3/api-reference/overview/enumerated-parameters#country-country-and-not-country).
	Countries *string `json:"-" url:"countries,omitempty"`
	// The publisher location countries to exclude from the search. The accepted format is the two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. To exclude multiple countries, use a comma-separated string.
	//
	// Example:`"US, CA"`
	//
	// To learn more, see [Enumerated parameters > Country](/docs/v3/api-reference/overview/enumerated-parameters#country-country-and-not-country).
	NotCountries *string `json:"-" url:"not_countries,omitempty"`
	// The list of author names to exclude from your search. To exclude articles by specific authors, use a comma-separated string.
	//
	// Example: `"John Doe, Jane Doe"`
	NotAuthorName *string `json:"-" url:"not_author_name,omitempty"`
	// The starting point in time to search from. Accepts date-time strings in ISO 8601 format and plain text. The default time zone is UTC.
	//
	// Formats with examples:
	// - YYYY-mm-ddTHH:MM:SS: `2024-07-01T00:00:00`
	// - YYYY-MM-dd: `2024-07-01`
	// - YYYY/mm/dd HH:MM:SS: `2024/07/01 00:00:00`
	// - YYYY/mm/dd: `2024/07/01`
	// - English phrases: `1 day ago`, `today`
	//
	// **Note**: By default, applied to the publication date of the article. To use the article's parse date instead, set the `by_parse_date` parameter to `true`.
	From *time.Time `json:"-" url:"from_,omitempty"`
	// The ending point in time to search up to. Accepts date-time strings in ISO 8601 format and plain text. The default time zone is UTC.
	//
	// Formats with examples:
	// - YYYY-mm-ddTHH:MM:SS: `2024-07-01T00:00:00`
	// - YYYY-MM-dd: `2024-07-01`
	// - YYYY/mm/dd HH:MM:SS: `2024/07/01 00:00:00`
	// - YYYY/mm/dd: `2024/07/01`
	// - English phrases: `1 day ago`, `today`
	//
	// **Note**: By default, applied to the publication date of the article. To use the article's parse date instead, set the `by_parse_date` parameter to `true`.
	To *time.Time `json:"-" url:"to_,omitempty"`
	// The precision of the published date. There are three types:
	// - `full`: The day and time of an article is correctly identified with the appropriate timezone.
	// - `timezone unknown`: The day and time of an article is correctly identified without timezone.
	// - `date`: Only the day is identified without an exact time.
	PublishedDatePrecision *SearchGetRequestPublishedDatePrecision `json:"-" url:"published_date_precision,omitempty"`
	// If true, the `from_` and `to_` parameters use article parse dates instead of published dates. Additionally, the `parse_date` variable is added to the output for each article object.
	ByParseDate *bool `json:"-" url:"by_parse_date,omitempty"`
	// The sorting order of the results. Possible values are:
	// - `relevancy`: The most relevant results first.
	// - `date`: The most recently published results first.
	// - `rank`: The results from the highest-ranked sources first.
	SortBy *SearchGetRequestSortBy `json:"-" url:"sort_by,omitempty"`
	// If true, limits the search to sources ranked in the top 1 million online websites. If false, includes unranked sources which are assigned a rank of 999999.
	RankedOnly *bool `json:"-" url:"ranked_only,omitempty"`
	// The lowest boundary of the rank of a news website to filter by. A lower rank indicates a more popular source.
	FromRank *int `json:"-" url:"from_rank,omitempty"`
	// The highest boundary of the rank of a news website to filter by. A lower rank indicates a more popular source.
	ToRank *int `json:"-" url:"to_rank,omitempty"`
	// If true, only returns articles that were posted on the home page of a given news domain.
	IsHeadline *bool `json:"-" url:"is_headline,omitempty"`
	// If true, returns only opinion pieces. If false, excludes opinion-based articles and returns news only.
	IsOpinion *bool `json:"-" url:"is_opinion,omitempty"`
	// If false, returns only articles that have publicly available complete content. Some publishers partially block content, so this setting ensures that only full articles are retrieved.
	IsPaidContent *bool `json:"-" url:"is_paid_content,omitempty"`
	// The categorical URL(s) to filter your search. To filter your search by multiple categorical URLs, use a comma-separated string.
	//
	// Example: `"wsj.com/politics, wsj.com/tech"`
	ParentUrl *string `json:"-" url:"parent_url,omitempty"`
	// The complete URL(s) mentioned in the article. For multiple URLs, use a comma-separated string.
	//
	// Example: `"https://aiindex.stanford.edu/report, https://www.stateof.ai"`
	//
	// For more details, see [Search by URL](/docs/v3/documentation/how-to/search-by-url).
	AllLinks *string `json:"-" url:"all_links,omitempty"`
	// The domain(s) mentioned in the article. For multiple domains, use a comma-separated string.
	//
	// Example: `"who.int, nih.gov"`
	//
	// For more details, see [Search by URL](/docs/v3/documentation/how-to/search-by-url).
	AllDomainLinks *string `json:"-" url:"all_domain_links,omitempty"`
	// If true, includes additional domain information in the response for each article:
	// - `is_news_domain`: Boolean indicating if the source is a news domain.
	// - `news_domain_type`: Type of news domain (e.g., `"Original Content"`).
	// - `news_type`: Category of news (e.g., `"News and Blogs"`).
	AdditionalDomainInfo *bool `json:"-" url:"additional_domain_info,omitempty"`
	// If true, filters results to include only news domains.
	IsNewsDomain *bool `json:"-" url:"is_news_domain,omitempty"`
	// Filters results based on the news domain type. Possible values are:
	// - `Original Content`: Sources that produce their own content.
	// - `Aggregator`: Sources that collect content from various other sources.
	// - `Press Releases`: Sources primarily publishing press releases.
	// - `Republisher`: Sources that republish content from other sources.
	// - `Other`: Sources that don't fit into main categories.
	NewsDomainType *SearchGetRequestNewsDomainType `json:"-" url:"news_domain_type,omitempty"`
	// Filters results based on the news type. Multiple types can be specified using a comma-separated string.
	//
	// Example: `"General News Outlets,Tech News and Updates"`
	//
	// For a complete list of available news types, see [Enumerated parameters > News type](/docs/v3/api-reference/overview/enumerated-parameters#news-type-news-type).
	NewsType *string `json:"-" url:"news_type,omitempty"`
	// The minimum number of words an article must contain. To be used for avoiding articles with small content.
	WordCountMin *int `json:"-" url:"word_count_min,omitempty"`
	// The maximum number of words an article can contain. To be used for avoiding articles with large content.
	WordCountMax *int `json:"-" url:"word_count_max,omitempty"`
	// The page number to scroll through the results. Use for pagination, as a single API response can return up to 1,000 articles.
	//
	// For details, see [How to paginate large datasets](https://www.newscatcherapi.com/docs/v3/documentation/how-to/paginate-large-datasets).
	Page *int `json:"-" url:"page,omitempty"`
	// The number of articles to return per page.
	PageSize *int `json:"-" url:"page_size,omitempty"`
	// Determines whether to group similar articles into clusters. If true, the API returns clustered results.
	//
	// To learn more, see [Clustering news articles](/docs/v3/documentation/guides-and-concepts/clustering-news-articles).
	ClusteringEnabled *bool `json:"-" url:"clustering_enabled,omitempty"`
	// Specifies which part of the article to use for determining similarity when clustering.
	//
	// Possible values are:
	// - `content`: Uses the full article content (default).
	// - `title`: Uses only the article title.
	// - `summary`: Uses the article summary.
	//
	// To learn more, see [Clustering news articles](/docs/v3/documentation/guides-and-concepts/clustering-news-articles).
	ClusteringVariable *SearchGetRequestClusteringVariable `json:"-" url:"clustering_variable,omitempty"`
	// Sets the similarity threshold for grouping articles into clusters. A lower value creates more inclusive clusters, while a higher value requires greater similarity between articles.
	//
	// Examples:
	// - `0.3`: Results in larger, more diverse clusters.
	// - `0.6`: Balances cluster size and article similarity (default).
	// - `0.9`: Creates smaller, tightly related clusters.
	//
	// To learn more, see [Clustering news articles](/docs/v3/documentation/guides-and-concepts/clustering-news-articles).
	ClusteringThreshold *float64 `json:"-" url:"clustering_threshold,omitempty"`
	// If true, includes an NLP layer with each article in the response. This layer provides enhanced information such as theme classification, article summary, sentiment analysis, tags, and named entity recognition.
	//
	// The NLP layer includes:
	// - Theme: General topic of the article.
	// - Summary: A concise overview of the article content.
	// - Sentiment: Separate scores for title and content (range: -1 to 1).
	// - Named entities: Identified persons (PER), organizations (ORG), locations (LOC), and miscellaneous entities (MISC).
	// - IPTC tags: Standardized news category tags.
	// - IAB tags: Content categories for digital advertising.
	//
	// **Note**: The `include_nlp_data` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	IncludeNlpData *bool `json:"-" url:"include_nlp_data,omitempty"`
	// If true, filters the results to include only articles with an NLP layer. This allows you to focus on articles that have been processed with advanced NLP techniques.
	//
	// **Note**: The `has_nlp` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	HasNlp *bool `json:"-" url:"has_nlp,omitempty"`
	// Filters articles based on their general topic, as determined by NLP analysis. To select multiple themes, use a comma-separated string.
	//
	// Example: `"Finance, Tech"`
	//
	// **Note**: The `theme` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	//
	// Available options: `Business`, `Economics`, `Entertainment`, `Finance`, `Health`, `Politics`, `Science`, `Sports`, `Tech`, `Crime`, `Financial Crime`, `Lifestyle`, `Automotive`, `Travel`, `Weather`, `General`.
	Theme *string `json:"-" url:"theme,omitempty"`
	// Inverse of the `theme` parameter. Excludes articles based on their general topic, as determined by NLP analysis. To exclude multiple themes, use a comma-separated string.
	//
	// Example: `"Crime, Tech"`
	//
	// **Note**: The `not_theme` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	NotTheme *string `json:"-" url:"not_theme,omitempty"`
	// Filters articles that mention specific organization names, as identified by NLP analysis. To specify multiple organizations, use a comma-separated string.
	//
	// Example: `"Apple, Microsoft"`
	//
	// **Note**: The `ORG_entity_name` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [Search by entity](/docs/v3/documentation/how-to/search-by-entity).
	OrgEntityName *string `json:"-" url:"ORG_entity_name,omitempty"`
	// Filters articles that mention specific person names, as identified by NLP analysis. To specify multiple names, use a comma-separated string.
	//
	// Example: `"Elon Musk, Jeff Bezos"`
	//
	// **Note**: The `PER_entity_name` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [Search by entity](/docs/v3/documentation/how-to/search-by-entity).
	PerEntityName *string `json:"-" url:"PER_entity_name,omitempty"`
	// Filters articles that mention specific location names, as identified by NLP analysis. To specify multiple locations, use a comma-separated string.
	//
	// Example: `"California, New York"`
	//
	// **Note**: The `LOC_entity_name` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [Search by entity](/docs/v3/documentation/how-to/search-by-entity).
	LocEntityName *string `json:"-" url:"LOC_entity_name,omitempty"`
	// Filters articles that mention other named entities not falling under person, organization, or location categories. Includes events, nationalities, products, works of art, and more. To specify multiple entities, use a comma-separated string.
	//
	// Example: `"Bitcoin, Blockchain"`
	//
	// **Note**: The `MISC_entity_name` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [Search by entity](/docs/v3/documentation/how-to/search-by-entity).
	MiscEntityName *string `json:"-" url:"MISC_entity_name,omitempty"`
	// Filters articles based on the minimum sentiment score of their titles.
	//
	// Range is `-1.0` to `1.0`, where:
	// - Negative values indicate negative sentiment.
	// - Positive values indicate positive sentiment.
	// - Values close to 0 indicate neutral sentiment.
	//
	// **Note**: The `title_sentiment_min` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	TitleSentimentMin *float64 `json:"-" url:"title_sentiment_min,omitempty"`
	// Filters articles based on the maximum sentiment score of their titles.
	//
	// Range is `-1.0` to `1.0`, where:
	// - Negative values indicate negative sentiment.
	// - Positive values indicate positive sentiment.
	// - Values close to 0 indicate neutral sentiment.
	//
	// **Note**: The `title_sentiment_max` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	TitleSentimentMax *float64 `json:"-" url:"title_sentiment_max,omitempty"`
	// Filters articles based on the minimum sentiment score of their content.
	//
	// Range is `-1.0` to `1.0`, where:
	// - Negative values indicate negative sentiment.
	// - Positive values indicate positive sentiment.
	// - Values close to 0 indicate neutral sentiment.
	//
	// **Note**: The `content_sentiment_min` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	ContentSentimentMin *float64 `json:"-" url:"content_sentiment_min,omitempty"`
	// Filters articles based on the maximum sentiment score of their content.
	//
	// Range is `-1.0` to `1.0`, where:
	// - Negative values indicate negative sentiment.
	// - Positive values indicate positive sentiment.
	// - Values close to 0 indicate neutral sentiment.
	//
	// **Note**: The `content_sentiment_max` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	ContentSentimentMax *float64 `json:"-" url:"content_sentiment_max,omitempty"`
	// Filters articles based on International Press Telecommunications Council (IPTC) media topic tags. To specify multiple IPTC tags, use a comma-separated string of tag IDs.
	//
	// Example: `"20000199, 20000209"`
	//
	// **Note**: The `iptc_tags` parameter is only available if tags are included in your subscription plan.
	//
	// To learn more, see [IPTC Media Topic NewsCodes](https://www.iptc.org/std/NewsCodes/treeview/mediatopic/mediatopic-en-GB.html).
	IptcTags *string `json:"-" url:"iptc_tags,omitempty"`
	// Inverse of the `iptc_tags` parameter. Excludes articles based on International Press Telecommunications Council (IPTC) media topic tags. To specify multiple IPTC tags to exclude, use a comma-separated string of tag IDs.
	//
	// Example: `"20000205, 20000209"`
	//
	// **Note**: The `not_iptc_tags` parameter is only available if tags are included in your subscription plan.
	//
	// To learn more, see [IPTC Media Topic NewsCodes](https://www.iptc.org/std/NewsCodes/treeview/mediatopic/mediatopic-en-GB.html).
	NotIptcTags *string `json:"-" url:"not_iptc_tags,omitempty"`
	// Filters articles based on Interactive Advertising Bureau (IAB) content categories. These tags provide a standardized taxonomy for digital advertising content categorization. To specify multiple IAB categories, use a comma-separated string.
	//
	// Example: `"Business, Events"`
	//
	// **Note**: The `iab_tags` parameter is only available if tags are included in your subscription plan.
	//
	// To learn more, see the [IAB Content taxonomy](https://iabtechlab.com/standards/content-taxonomy/).
	IabTags *string `json:"-" url:"iab_tags,omitempty"`
	// Inverse of the `iab_tags` parameter. Excludes articles based on Interactive Advertising Bureau (IAB) content categories. These tags provide a standardized taxonomy for digital advertising content categorization. To specify multiple IAB categories to exclude, use a comma-separated string.
	//
	// Example: `"Agriculture, Metals"`
	//
	// **Note**: The `not_iab_tags` parameter is only available if tags are included in your subscription plan.
	//
	// To learn more, see the [IAB Content taxonomy](https://iabtechlab.com/standards/content-taxonomy/).
	NotIabTags *string `json:"-" url:"not_iab_tags,omitempty"`
	// Filters articles based on provided taxonomy that is tailored to your specific needs and is accessible only with your API key. To specify tags, use the following pattern:
	//
	// - `custom_tags.taxonomy=Tag1,Tag2,Tag3`, where `taxonomy` is the taxonomy name and `Tag1,Tag2,Tag3` is a comma-separated list of tags.
	//
	// Example: `custom_tags.industry="Manufacturing, Supply Chain, Logistics"`
	//
	// To learn more, see the [Custom tags](/docs/v3/documentation/guides-and-concepts/custom-tags).
	CustomTags *string `json:"-" url:"custom_tags,omitempty"`
	// If true, excludes duplicate and highly similar articles from the search results. If false, returns all relevant articles, including duplicates.
	//
	// To learn more, see [Articles deduplication](/docs/v3/documentation/guides-and-concepts/articles-deduplication).
	ExcludeDuplicates *bool `json:"-" url:"exclude_duplicates,omitempty"`
}

type SearchGetRequestClusteringVariable added in v1.1.0

type SearchGetRequestClusteringVariable string
const (
	SearchGetRequestClusteringVariableContent SearchGetRequestClusteringVariable = "content"
	SearchGetRequestClusteringVariableTitle   SearchGetRequestClusteringVariable = "title"
	SearchGetRequestClusteringVariableSummary SearchGetRequestClusteringVariable = "summary"
)

func NewSearchGetRequestClusteringVariableFromString added in v1.1.0

func NewSearchGetRequestClusteringVariableFromString(s string) (SearchGetRequestClusteringVariable, error)

func (SearchGetRequestClusteringVariable) Ptr added in v1.1.0

type SearchGetRequestNewsDomainType added in v1.1.0

type SearchGetRequestNewsDomainType string
const (
	SearchGetRequestNewsDomainTypeOriginalContent SearchGetRequestNewsDomainType = "Original Content"
	SearchGetRequestNewsDomainTypeAggregator      SearchGetRequestNewsDomainType = "Aggregator"
	SearchGetRequestNewsDomainTypePressReleases   SearchGetRequestNewsDomainType = "Press Releases"
	SearchGetRequestNewsDomainTypeRepublisher     SearchGetRequestNewsDomainType = "Republisher"
	SearchGetRequestNewsDomainTypeOther           SearchGetRequestNewsDomainType = "Other"
)

func NewSearchGetRequestNewsDomainTypeFromString added in v1.1.0

func NewSearchGetRequestNewsDomainTypeFromString(s string) (SearchGetRequestNewsDomainType, error)

func (SearchGetRequestNewsDomainType) Ptr added in v1.1.0

type SearchGetRequestPublishedDatePrecision added in v1.1.0

type SearchGetRequestPublishedDatePrecision string
const (
	SearchGetRequestPublishedDatePrecisionFull            SearchGetRequestPublishedDatePrecision = "full"
	SearchGetRequestPublishedDatePrecisionTimezoneUnknown SearchGetRequestPublishedDatePrecision = "timezone unknown"
	SearchGetRequestPublishedDatePrecisionDate            SearchGetRequestPublishedDatePrecision = "date"
)

func NewSearchGetRequestPublishedDatePrecisionFromString added in v1.1.0

func NewSearchGetRequestPublishedDatePrecisionFromString(s string) (SearchGetRequestPublishedDatePrecision, error)

func (SearchGetRequestPublishedDatePrecision) Ptr added in v1.1.0

type SearchGetRequestSortBy added in v1.1.0

type SearchGetRequestSortBy string
const (
	SearchGetRequestSortByRelevancy SearchGetRequestSortBy = "relevancy"
	SearchGetRequestSortByDate      SearchGetRequestSortBy = "date"
	SearchGetRequestSortByRank      SearchGetRequestSortBy = "rank"
)

func NewSearchGetRequestSortByFromString added in v1.1.0

func NewSearchGetRequestSortByFromString(s string) (SearchGetRequestSortBy, error)

func (SearchGetRequestSortBy) Ptr added in v1.1.0

type SearchGetResponse

type SearchGetResponse struct {
	SearchResponseDto          *SearchResponseDto
	ClusteredSearchResponseDto *ClusteredSearchResponseDto
	// contains filtered or unexported fields
}

func NewSearchGetResponseFromClusteredSearchResponseDto added in v1.1.0

func NewSearchGetResponseFromClusteredSearchResponseDto(value *ClusteredSearchResponseDto) *SearchGetResponse

func NewSearchGetResponseFromSearchResponseDto added in v1.1.0

func NewSearchGetResponseFromSearchResponseDto(value *SearchResponseDto) *SearchGetResponse

func (*SearchGetResponse) Accept

func (*SearchGetResponse) GetClusteredSearchResponseDto added in v1.1.0

func (s *SearchGetResponse) GetClusteredSearchResponseDto() *ClusteredSearchResponseDto

func (*SearchGetResponse) GetSearchResponseDto added in v1.1.0

func (s *SearchGetResponse) GetSearchResponseDto() *SearchResponseDto

func (SearchGetResponse) MarshalJSON

func (s SearchGetResponse) MarshalJSON() ([]byte, error)

func (*SearchGetResponse) UnmarshalJSON

func (s *SearchGetResponse) UnmarshalJSON(data []byte) error

type SearchGetResponseVisitor

type SearchGetResponseVisitor interface {
	VisitSearchResponseDto(*SearchResponseDto) error
	VisitClusteredSearchResponseDto(*ClusteredSearchResponseDto) error
}

type SearchIn added in v1.1.0

type SearchIn = string

The article fields to search in. To search in multiple fields, use a comma-separated string.

Example: `"title, summary"`

**Note**: The `summary` option is available if NLP is enabled in your plan.

Available options: `title`, `summary`, `content`.

type SearchPostRequest added in v1.1.0

type SearchPostRequest struct {
	Q                      Q                       `json:"q" url:"-"`
	SearchIn               *SearchIn               `json:"search_in,omitempty" url:"-"`
	PredefinedSources      *PredefinedSources      `json:"predefined_sources,omitempty" url:"-"`
	SourceName             *SourceName             `json:"source_name,omitempty" url:"-"`
	Sources                *Sources                `json:"sources,omitempty" url:"-"`
	NotSources             *NotSources             `json:"not_sources,omitempty" url:"-"`
	Lang                   *Lang                   `json:"lang,omitempty" url:"-"`
	NotLang                *NotLang                `json:"not_lang,omitempty" url:"-"`
	Countries              *Countries              `json:"countries,omitempty" url:"-"`
	NotCountries           *NotCountries           `json:"not_countries,omitempty" url:"-"`
	NotAuthorName          *NotAuthorName          `json:"not_author_name,omitempty" url:"-"`
	From                   *From                   `json:"from_,omitempty" url:"-"`
	To                     *To                     `json:"to_,omitempty" url:"-"`
	PublishedDatePrecision *PublishedDatePrecision `json:"published_date_precision,omitempty" url:"-"`
	ByParseDate            *ByParseDate            `json:"by_parse_date,omitempty" url:"-"`
	SortBy                 *SortBy                 `json:"sort_by,omitempty" url:"-"`
	RankedOnly             *RankedOnly             `json:"ranked_only,omitempty" url:"-"`
	FromRank               *FromRank               `json:"from_rank,omitempty" url:"-"`
	ToRank                 *ToRank                 `json:"to_rank,omitempty" url:"-"`
	IsHeadline             *IsHeadline             `json:"is_headline,omitempty" url:"-"`
	IsOpinion              *IsOpinion              `json:"is_opinion,omitempty" url:"-"`
	IsPaidContent          *IsPaidContent          `json:"is_paid_content,omitempty" url:"-"`
	ParentUrl              *ParentUrl              `json:"parent_url,omitempty" url:"-"`
	AllLinks               *AllLinks               `json:"all_links,omitempty" url:"-"`
	AllDomainLinks         *AllDomainLinks         `json:"all_domain_links,omitempty" url:"-"`
	AdditionalDomainInfo   *AdditionalDomainInfo   `json:"additional_domain_info,omitempty" url:"-"`
	IsNewsDomain           *IsNewsDomain           `json:"is_news_domain,omitempty" url:"-"`
	NewsDomainType         *NewsDomainType         `json:"news_domain_type,omitempty" url:"-"`
	NewsType               *NewsType               `json:"news_type,omitempty" url:"-"`
	WordCountMin           *WordCountMin           `json:"word_count_min,omitempty" url:"-"`
	WordCountMax           *WordCountMax           `json:"word_count_max,omitempty" url:"-"`
	Page                   *Page                   `json:"page,omitempty" url:"-"`
	PageSize               *PageSize               `json:"page_size,omitempty" url:"-"`
	ClusteringEnabled      *ClusteringEnabled      `json:"clustering_enabled,omitempty" url:"-"`
	ClusteringVariable     *ClusteringVariable     `json:"clustering_variable,omitempty" url:"-"`
	ClusteringThreshold    *ClusteringThreshold    `json:"clustering_threshold,omitempty" url:"-"`
	IncludeNlpData         *IncludeNlpData         `json:"include_nlp_data,omitempty" url:"-"`
	HasNlp                 *HasNlp                 `json:"has_nlp,omitempty" url:"-"`
	Theme                  *Theme                  `json:"theme,omitempty" url:"-"`
	NotTheme               *NotTheme               `json:"not_theme,omitempty" url:"-"`
	OrgEntityName          *OrgEntityName          `json:"ORG_entity_name,omitempty" url:"-"`
	PerEntityName          *PerEntityName          `json:"PER_entity_name,omitempty" url:"-"`
	LocEntityName          *LocEntityName          `json:"LOC_entity_name,omitempty" url:"-"`
	MiscEntityName         *MiscEntityName         `json:"MISC_entity_name,omitempty" url:"-"`
	TitleSentimentMin      *TitleSentimentMin      `json:"title_sentiment_min,omitempty" url:"-"`
	TitleSentimentMax      *TitleSentimentMax      `json:"title_sentiment_max,omitempty" url:"-"`
	ContentSentimentMin    *ContentSentimentMin    `json:"content_sentiment_min,omitempty" url:"-"`
	ContentSentientMax     *ContentSentimentMax    `json:"content_sentient_max,omitempty" url:"-"`
	IptcTags               *IptcTags               `json:"iptc_tags,omitempty" url:"-"`
	NotIptcTags            *NotIptcTags            `json:"not_iptc_tags,omitempty" url:"-"`
	IabTags                *IabTags                `json:"iab_tags,omitempty" url:"-"`
	NotIabTags             *NotIabTags             `json:"not_iab_tags,omitempty" url:"-"`
	CustomTags             *CustomTags             `json:"custom_tags,omitempty" url:"-"`
	ExcludeDuplicates      *ExcludeDuplicates      `json:"exclude_duplicates,omitempty" url:"-"`
}

type SearchPostResponse

type SearchPostResponse struct {
	SearchResponseDto          *SearchResponseDto
	ClusteredSearchResponseDto *ClusteredSearchResponseDto
	// contains filtered or unexported fields
}

func NewSearchPostResponseFromClusteredSearchResponseDto added in v1.1.0

func NewSearchPostResponseFromClusteredSearchResponseDto(value *ClusteredSearchResponseDto) *SearchPostResponse

func NewSearchPostResponseFromSearchResponseDto added in v1.1.0

func NewSearchPostResponseFromSearchResponseDto(value *SearchResponseDto) *SearchPostResponse

func (*SearchPostResponse) Accept

func (*SearchPostResponse) GetClusteredSearchResponseDto added in v1.1.0

func (s *SearchPostResponse) GetClusteredSearchResponseDto() *ClusteredSearchResponseDto

func (*SearchPostResponse) GetSearchResponseDto added in v1.1.0

func (s *SearchPostResponse) GetSearchResponseDto() *SearchResponseDto

func (SearchPostResponse) MarshalJSON

func (s SearchPostResponse) MarshalJSON() ([]byte, error)

func (*SearchPostResponse) UnmarshalJSON

func (s *SearchPostResponse) UnmarshalJSON(data []byte) error

type SearchPostResponseVisitor

type SearchPostResponseVisitor interface {
	VisitSearchResponseDto(*SearchResponseDto) error
	VisitClusteredSearchResponseDto(*ClusteredSearchResponseDto) error
}

type SearchResponseDto added in v1.1.0

type SearchResponseDto struct {
	// The status of the response.
	Status string `json:"status" url:"status"`
	// The total number of articles matching the search criteria.
	TotalHits int `json:"total_hits" url:"total_hits"`
	// The current page number of the results.
	Page int `json:"page" url:"page"`
	// The total number of pages available for the given search criteria.
	TotalPages int `json:"total_pages" url:"total_pages"`
	// The number of articles per page.
	PageSize  int           `json:"page_size" url:"page_size"`
	Articles  *Articles     `json:"articles,omitempty" url:"articles,omitempty"`
	UserInput *UserInputDto `json:"user_input,omitempty" url:"user_input,omitempty"`
	// contains filtered or unexported fields
}

The response model for the search requests applies to the `Search`, `Latest Headlines`, `Search by link`, and `Authors` endpoints. Response field behavior: - Required fields are guaranteed to be present and non-null. - Optional fields may be `null`/`undefined` if the data couldn't be extracted during processing. - To access article properties in the `articles` response array, use array index notation. For example, `articles[n].title`, where `n` is the zero-based index of the article object (0, 1, 2, etc.). - The `nlp` property within the article object `articles[n].nlp` is only available with NLP-enabled subscription plans.

func (*SearchResponseDto) GetArticles added in v1.1.0

func (s *SearchResponseDto) GetArticles() *Articles

func (*SearchResponseDto) GetExtraProperties added in v1.1.0

func (s *SearchResponseDto) GetExtraProperties() map[string]interface{}

func (*SearchResponseDto) GetPage added in v1.1.0

func (s *SearchResponseDto) GetPage() int

func (*SearchResponseDto) GetPageSize added in v1.1.0

func (s *SearchResponseDto) GetPageSize() int

func (*SearchResponseDto) GetStatus added in v1.1.0

func (s *SearchResponseDto) GetStatus() string

func (*SearchResponseDto) GetTotalHits added in v1.1.0

func (s *SearchResponseDto) GetTotalHits() int

func (*SearchResponseDto) GetTotalPages added in v1.1.0

func (s *SearchResponseDto) GetTotalPages() int

func (*SearchResponseDto) GetUserInput added in v1.1.0

func (s *SearchResponseDto) GetUserInput() *UserInputDto

func (*SearchResponseDto) String added in v1.1.0

func (s *SearchResponseDto) String() string

func (*SearchResponseDto) UnmarshalJSON added in v1.1.0

func (s *SearchResponseDto) UnmarshalJSON(data []byte) error

type SearchSimilarGetRequest

type SearchSimilarGetRequest struct {
	// The keyword(s) to search for in articles. Query syntax supports logical operators (`AND`, `OR`, `NOT`) and wildcards:
	//
	//   - For an exact match, use double quotes. For example, `"technology news"`.
	//   - Use `*` to search for any keyword.
	//   - Use `+` to include and `-` to exclude specific words or phrases.
	//     For example, `+Apple`, `-Google`.
	//   - Use `AND`, `OR`, and `NOT` to refine search results.
	//     For example, `technology AND (Apple OR Microsoft) NOT Google`.
	//
	// For more details, see [Advanced querying](/docs/v3/documentation/guides-and-concepts/advanced-querying).
	Q string `json:"-" url:"q"`
	// The article fields to search in. To search in multiple fields, use a comma-separated string.
	//
	// Example: `"title, summary"`
	//
	// **Note**: The `summary` option is available if NLP is enabled in your plan.
	//
	// Available options: `title`, `summary`, `content`.
	SearchIn *string `json:"-" url:"search_in,omitempty"`
	// If true, includes similar documents in the response.
	IncludeSimilarDocuments *bool `json:"-" url:"include_similar_documents,omitempty"`
	// The number of similar documents to return.
	SimilarDocumentsNumber *int `json:"-" url:"similar_documents_number,omitempty"`
	// The fields to consider for finding similar documents.
	SimilarDocumentsFields *string `json:"-" url:"similar_documents_fields,omitempty"`
	// Predefined top news sources per country.
	//
	// Format: start with the word `top`, followed by the number of desired sources, and then the two-letter country code [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Multiple countries with the number of top sources can be specified as a comma-separated string.
	//
	// Examples:
	// - `"top 100 US"`
	// - `"top 33 AT"`
	// - `"top 50 US, top 20 GB"`
	// - `"top 33 AT, top 50 IT"`
	PredefinedSources *string `json:"-" url:"predefined_sources,omitempty"`
	// One or more news sources to narrow down the search. The format must be a domain URL. Subdomains, such as `finance.yahoo.com`, are also acceptable.To specify multiple sources, use a comma-separated string.
	//
	// Examples:
	// - `"nytimes.com"`
	// - `"theguardian.com, finance.yahoo.com"`
	Sources *string `json:"-" url:"sources,omitempty"`
	// The news sources to exclude from the search. To exclude multiple sources, use a comma-separated string.
	//
	// Example: `"cnn.com, wsj.com"`
	NotSources *string `json:"-" url:"not_sources,omitempty"`
	// The language(s) of the search. The only accepted format is the two-letter [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) code. To select multiple languages, use a comma-separated string.
	//
	// Example: `"en, es"`
	//
	// To learn more, see [Enumerated parameters > Language](/docs/v3/api-reference/overview/enumerated-parameters#language-lang-and-not-lang).
	Lang *string `json:"-" url:"lang,omitempty"`
	// The language(s) to exclude from the search. The accepted format is the two-letter [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) code. To exclude multiple languages, use a comma-separated string.
	//
	// Example: `"fr, de"`
	//
	// To learn more, see [Enumerated parameters > Language](/docs/v3/api-reference/overview/enumerated-parameters#language-lang-and-not-lang).
	NotLang *string `json:"-" url:"not_lang,omitempty"`
	// The countries where the news publisher is located. The accepted format is the two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. To select multiple countries, use a comma-separated string.
	//
	// Example: `"US, CA"`
	//
	// To learn more, see [Enumerated parameters > Country](/docs/v3/api-reference/overview/enumerated-parameters#country-country-and-not-country).
	Countries *string `json:"-" url:"countries,omitempty"`
	// The publisher location countries to exclude from the search. The accepted format is the two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. To exclude multiple countries, use a comma-separated string.
	//
	// Example:`"US, CA"`
	//
	// To learn more, see [Enumerated parameters > Country](/docs/v3/api-reference/overview/enumerated-parameters#country-country-and-not-country).
	NotCountries *string `json:"-" url:"not_countries,omitempty"`
	// The starting point in time to search from. Accepts date-time strings in ISO 8601 format and plain text. The default time zone is UTC.
	//
	// Formats with examples:
	// - YYYY-mm-ddTHH:MM:SS: `2024-07-01T00:00:00`
	// - YYYY-MM-dd: `2024-07-01`
	// - YYYY/mm/dd HH:MM:SS: `2024/07/01 00:00:00`
	// - YYYY/mm/dd: `2024/07/01`
	// - English phrases: `1 day ago`, `today`
	//
	// **Note**: By default, applied to the publication date of the article. To use the article's parse date instead, set the `by_parse_date` parameter to `true`.
	From *time.Time `json:"-" url:"from_,omitempty"`
	// The ending point in time to search up to. Accepts date-time strings in ISO 8601 format and plain text. The default time zone is UTC.
	//
	// Formats with examples:
	// - YYYY-mm-ddTHH:MM:SS: `2024-07-01T00:00:00`
	// - YYYY-MM-dd: `2024-07-01`
	// - YYYY/mm/dd HH:MM:SS: `2024/07/01 00:00:00`
	// - YYYY/mm/dd: `2024/07/01`
	// - English phrases: `1 day ago`, `today`
	//
	// **Note**: By default, applied to the publication date of the article. To use the article's parse date instead, set the `by_parse_date` parameter to `true`.
	To *time.Time `json:"-" url:"to_,omitempty"`
	// If true, the `from_` and `to_` parameters use article parse dates instead of published dates. Additionally, the `parse_date` variable is added to the output for each article object.
	ByParseDate *bool `json:"-" url:"by_parse_date,omitempty"`
	// The precision of the published date. There are three types:
	// - `full`: The day and time of an article is correctly identified with the appropriate timezone.
	// - `timezone unknown`: The day and time of an article is correctly identified without timezone.
	// - `date`: Only the day is identified without an exact time.
	PublishedDatePrecision *SearchSimilarGetRequestPublishedDatePrecision `json:"-" url:"published_date_precision,omitempty"`
	// The sorting order of the results. Possible values are:
	// - `relevancy`: The most relevant results first.
	// - `date`: The most recently published results first.
	// - `rank`: The results from the highest-ranked sources first.
	SortBy *SearchSimilarGetRequestSortBy `json:"-" url:"sort_by,omitempty"`
	// If true, limits the search to sources ranked in the top 1 million online websites. If false, includes unranked sources which are assigned a rank of 999999.
	RankedOnly *bool `json:"-" url:"ranked_only,omitempty"`
	// The lowest boundary of the rank of a news website to filter by. A lower rank indicates a more popular source.
	FromRank *int `json:"-" url:"from_rank,omitempty"`
	// The highest boundary of the rank of a news website to filter by. A lower rank indicates a more popular source.
	ToRank *int `json:"-" url:"to_rank,omitempty"`
	// If true, only returns articles that were posted on the home page of a given news domain.
	IsHeadline *bool `json:"-" url:"is_headline,omitempty"`
	// If true, returns only opinion pieces. If false, excludes opinion-based articles and returns news only.
	IsOpinion *bool `json:"-" url:"is_opinion,omitempty"`
	// If false, returns only articles that have publicly available complete content. Some publishers partially block content, so this setting ensures that only full articles are retrieved.
	IsPaidContent *bool `json:"-" url:"is_paid_content,omitempty"`
	// The categorical URL(s) to filter your search. To filter your search by multiple categorical URLs, use a comma-separated string.
	//
	// Example: `"wsj.com/politics, wsj.com/tech"`
	ParentUrl *string `json:"-" url:"parent_url,omitempty"`
	// The complete URL(s) mentioned in the article. For multiple URLs, use a comma-separated string.
	//
	// Example: `"https://aiindex.stanford.edu/report, https://www.stateof.ai"`
	//
	// For more details, see [Search by URL](/docs/v3/documentation/how-to/search-by-url).
	AllLinks *string `json:"-" url:"all_links,omitempty"`
	// The domain(s) mentioned in the article. For multiple domains, use a comma-separated string.
	//
	// Example: `"who.int, nih.gov"`
	//
	// For more details, see [Search by URL](/docs/v3/documentation/how-to/search-by-url).
	AllDomainLinks *string `json:"-" url:"all_domain_links,omitempty"`
	// The minimum number of words an article must contain. To be used for avoiding articles with small content.
	WordCountMin *int `json:"-" url:"word_count_min,omitempty"`
	// The maximum number of words an article can contain. To be used for avoiding articles with large content.
	WordCountMax *int `json:"-" url:"word_count_max,omitempty"`
	// The page number to scroll through the results. Use for pagination, as a single API response can return up to 1,000 articles.
	//
	// For details, see [How to paginate large datasets](https://www.newscatcherapi.com/docs/v3/documentation/how-to/paginate-large-datasets).
	Page *int `json:"-" url:"page,omitempty"`
	// The number of articles to return per page.
	PageSize *int `json:"-" url:"page_size,omitempty"`
	// If true, includes an NLP layer with each article in the response. This layer provides enhanced information such as theme classification, article summary, sentiment analysis, tags, and named entity recognition.
	//
	// The NLP layer includes:
	// - Theme: General topic of the article.
	// - Summary: A concise overview of the article content.
	// - Sentiment: Separate scores for title and content (range: -1 to 1).
	// - Named entities: Identified persons (PER), organizations (ORG), locations (LOC), and miscellaneous entities (MISC).
	// - IPTC tags: Standardized news category tags.
	// - IAB tags: Content categories for digital advertising.
	//
	// **Note**: The `include_nlp_data` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	IncludeNlpData *bool `json:"-" url:"include_nlp_data,omitempty"`
	// If true, filters the results to include only articles with an NLP layer. This allows you to focus on articles that have been processed with advanced NLP techniques.
	//
	// **Note**: The `has_nlp` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	HasNlp *bool `json:"-" url:"has_nlp,omitempty"`
	// Filters articles based on their general topic, as determined by NLP analysis. To select multiple themes, use a comma-separated string.
	//
	// Example: `"Finance, Tech"`
	//
	// **Note**: The `theme` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	//
	// Available options: `Business`, `Economics`, `Entertainment`, `Finance`, `Health`, `Politics`, `Science`, `Sports`, `Tech`, `Crime`, `Financial Crime`, `Lifestyle`, `Automotive`, `Travel`, `Weather`, `General`.
	Theme *string `json:"-" url:"theme,omitempty"`
	// Inverse of the `theme` parameter. Excludes articles based on their general topic, as determined by NLP analysis. To exclude multiple themes, use a comma-separated string.
	//
	// Example: `"Crime, Tech"`
	//
	// **Note**: The `not_theme` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	NotTheme *string `json:"-" url:"not_theme,omitempty"`
	// The name of person, organization, location, product or other named entity to search for. To specify multiple names use a comma-separated string.
	//
	// Example: `"Tesla, Amazon"`
	NerName *string `json:"-" url:"ner_name,omitempty"`
	// Filters articles based on the minimum sentiment score of their titles.
	//
	// Range is `-1.0` to `1.0`, where:
	// - Negative values indicate negative sentiment.
	// - Positive values indicate positive sentiment.
	// - Values close to 0 indicate neutral sentiment.
	//
	// **Note**: The `title_sentiment_min` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	TitleSentimentMin *float64 `json:"-" url:"title_sentiment_min,omitempty"`
	// Filters articles based on the maximum sentiment score of their titles.
	//
	// Range is `-1.0` to `1.0`, where:
	// - Negative values indicate negative sentiment.
	// - Positive values indicate positive sentiment.
	// - Values close to 0 indicate neutral sentiment.
	//
	// **Note**: The `title_sentiment_max` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	TitleSentimentMax *float64 `json:"-" url:"title_sentiment_max,omitempty"`
	// Filters articles based on the minimum sentiment score of their content.
	//
	// Range is `-1.0` to `1.0`, where:
	// - Negative values indicate negative sentiment.
	// - Positive values indicate positive sentiment.
	// - Values close to 0 indicate neutral sentiment.
	//
	// **Note**: The `content_sentiment_min` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	ContentSentimentMin *float64 `json:"-" url:"content_sentiment_min,omitempty"`
	// Filters articles based on the maximum sentiment score of their content.
	//
	// Range is `-1.0` to `1.0`, where:
	// - Negative values indicate negative sentiment.
	// - Positive values indicate positive sentiment.
	// - Values close to 0 indicate neutral sentiment.
	//
	// **Note**: The `content_sentiment_max` parameter is only available if NLP is included in your subscription plan.
	//
	// To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).
	ContentSentimentMax *float64 `json:"-" url:"content_sentiment_max,omitempty"`
	// Filters articles based on International Press Telecommunications Council (IPTC) media topic tags. To specify multiple IPTC tags, use a comma-separated string of tag IDs.
	//
	// Example: `"20000199, 20000209"`
	//
	// **Note**: The `iptc_tags` parameter is only available if tags are included in your subscription plan.
	//
	// To learn more, see [IPTC Media Topic NewsCodes](https://www.iptc.org/std/NewsCodes/treeview/mediatopic/mediatopic-en-GB.html).
	IptcTags *string `json:"-" url:"iptc_tags,omitempty"`
	// Inverse of the `iptc_tags` parameter. Excludes articles based on International Press Telecommunications Council (IPTC) media topic tags. To specify multiple IPTC tags to exclude, use a comma-separated string of tag IDs.
	//
	// Example: `"20000205, 20000209"`
	//
	// **Note**: The `not_iptc_tags` parameter is only available if tags are included in your subscription plan.
	//
	// To learn more, see [IPTC Media Topic NewsCodes](https://www.iptc.org/std/NewsCodes/treeview/mediatopic/mediatopic-en-GB.html).
	NotIptcTags *string `json:"-" url:"not_iptc_tags,omitempty"`
	// Filters articles based on provided taxonomy that is tailored to your specific needs and is accessible only with your API key. To specify tags, use the following pattern:
	//
	// - `custom_tags.taxonomy=Tag1,Tag2,Tag3`, where `taxonomy` is the taxonomy name and `Tag1,Tag2,Tag3` is a comma-separated list of tags.
	//
	// Example: `custom_tags.industry="Manufacturing, Supply Chain, Logistics"`
	//
	// To learn more, see the [Custom tags](/docs/v3/documentation/guides-and-concepts/custom-tags).
	CustomTags *string `json:"-" url:"custom_tags,omitempty"`
}

type SearchSimilarGetRequestPublishedDatePrecision added in v1.1.0

type SearchSimilarGetRequestPublishedDatePrecision string
const (
	SearchSimilarGetRequestPublishedDatePrecisionFull            SearchSimilarGetRequestPublishedDatePrecision = "full"
	SearchSimilarGetRequestPublishedDatePrecisionTimezoneUnknown SearchSimilarGetRequestPublishedDatePrecision = "timezone unknown"
	SearchSimilarGetRequestPublishedDatePrecisionDate            SearchSimilarGetRequestPublishedDatePrecision = "date"
)

func NewSearchSimilarGetRequestPublishedDatePrecisionFromString added in v1.1.0

func NewSearchSimilarGetRequestPublishedDatePrecisionFromString(s string) (SearchSimilarGetRequestPublishedDatePrecision, error)

func (SearchSimilarGetRequestPublishedDatePrecision) Ptr added in v1.1.0

type SearchSimilarGetRequestSortBy added in v1.1.0

type SearchSimilarGetRequestSortBy string
const (
	SearchSimilarGetRequestSortByRelevancy SearchSimilarGetRequestSortBy = "relevancy"
	SearchSimilarGetRequestSortByDate      SearchSimilarGetRequestSortBy = "date"
	SearchSimilarGetRequestSortByRank      SearchSimilarGetRequestSortBy = "rank"
)

func NewSearchSimilarGetRequestSortByFromString added in v1.1.0

func NewSearchSimilarGetRequestSortByFromString(s string) (SearchSimilarGetRequestSortBy, error)

func (SearchSimilarGetRequestSortBy) Ptr added in v1.1.0

type SearchSimilarGetResponse

type SearchSimilarGetResponse struct {
	SearchSimilarResponseDto       *SearchSimilarResponseDto
	FailedSearchSimilarResponseDto *FailedSearchSimilarResponseDto
	// contains filtered or unexported fields
}

func NewSearchSimilarGetResponseFromFailedSearchSimilarResponseDto added in v1.1.0

func NewSearchSimilarGetResponseFromFailedSearchSimilarResponseDto(value *FailedSearchSimilarResponseDto) *SearchSimilarGetResponse

func NewSearchSimilarGetResponseFromSearchSimilarResponseDto added in v1.1.0

func NewSearchSimilarGetResponseFromSearchSimilarResponseDto(value *SearchSimilarResponseDto) *SearchSimilarGetResponse

func (*SearchSimilarGetResponse) Accept

func (*SearchSimilarGetResponse) GetFailedSearchSimilarResponseDto added in v1.1.0

func (s *SearchSimilarGetResponse) GetFailedSearchSimilarResponseDto() *FailedSearchSimilarResponseDto

func (*SearchSimilarGetResponse) GetSearchSimilarResponseDto added in v1.1.0

func (s *SearchSimilarGetResponse) GetSearchSimilarResponseDto() *SearchSimilarResponseDto

func (SearchSimilarGetResponse) MarshalJSON

func (s SearchSimilarGetResponse) MarshalJSON() ([]byte, error)

func (*SearchSimilarGetResponse) UnmarshalJSON

func (s *SearchSimilarGetResponse) UnmarshalJSON(data []byte) error

type SearchSimilarGetResponseVisitor

type SearchSimilarGetResponseVisitor interface {
	VisitSearchSimilarResponseDto(*SearchSimilarResponseDto) error
	VisitFailedSearchSimilarResponseDto(*FailedSearchSimilarResponseDto) error
}

type SearchSimilarPostRequest added in v1.1.0

type SearchSimilarPostRequest struct {
	Q                       Q                        `json:"q" url:"-"`
	SearchIn                *SearchIn                `json:"search_in,omitempty" url:"-"`
	IncludeSimilarDocuments *IncludeSimilarDocuments `json:"include_similar_documents,omitempty" url:"-"`
	SimilarDocumentsNumber  *SimilarDocumentsNumber  `json:"similar_documents_number,omitempty" url:"-"`
	SimilarDocumentsFields  *SimilarDocumentsFields  `json:"similar_documents_fields,omitempty" url:"-"`
	PredefinedSources       *PredefinedSources       `json:"predefined_sources,omitempty" url:"-"`
	Sources                 *Sources                 `json:"sources,omitempty" url:"-"`
	NotSources              *NotSources              `json:"not_sources,omitempty" url:"-"`
	Lang                    *Lang                    `json:"lang,omitempty" url:"-"`
	NotLang                 *NotLang                 `json:"not_lang,omitempty" url:"-"`
	Countries               *Countries               `json:"countries,omitempty" url:"-"`
	NotCountries            *NotCountries            `json:"not_countries,omitempty" url:"-"`
	From                    *From                    `json:"from_,omitempty" url:"-"`
	To                      *To                      `json:"to_,omitempty" url:"-"`
	ByParseDate             *ByParseDate             `json:"by_parse_date,omitempty" url:"-"`
	PublishedDatePrecision  *PublishedDatePrecision  `json:"published_date_precision,omitempty" url:"-"`
	SortBy                  *SortBy                  `json:"sort_by,omitempty" url:"-"`
	RankedOnly              *RankedOnly              `json:"ranked_only,omitempty" url:"-"`
	FromRank                *FromRank                `json:"from_rank,omitempty" url:"-"`
	ToRank                  *ToRank                  `json:"to_rank,omitempty" url:"-"`
	IsHeadline              *IsHeadline              `json:"is_headline,omitempty" url:"-"`
	IsOpinion               *IsOpinion               `json:"is_opinion,omitempty" url:"-"`
	IsPaidContent           *IsPaidContent           `json:"is_paid_content,omitempty" url:"-"`
	ParentUrl               *ParentUrl               `json:"parent_url,omitempty" url:"-"`
	AllLinks                *AllLinks                `json:"all_links,omitempty" url:"-"`
	AllDomainLinks          *AllDomainLinks          `json:"all_domain_links,omitempty" url:"-"`
	WordCountMin            *WordCountMin            `json:"word_count_min,omitempty" url:"-"`
	WordCountMax            *WordCountMax            `json:"word_count_max,omitempty" url:"-"`
	Page                    *Page                    `json:"page,omitempty" url:"-"`
	PageSize                *PageSize                `json:"page_size,omitempty" url:"-"`
	IncludeNlpData          *IncludeNlpData          `json:"include_nlp_data,omitempty" url:"-"`
	HasNlp                  *HasNlp                  `json:"has_nlp,omitempty" url:"-"`
	Theme                   *Theme                   `json:"theme,omitempty" url:"-"`
	NotTheme                *NotTheme                `json:"not_theme,omitempty" url:"-"`
	NerName                 *NerName                 `json:"ner_name,omitempty" url:"-"`
	TitleSentimentMin       *TitleSentimentMin       `json:"title_sentiment_min,omitempty" url:"-"`
	TitleSentimentMax       *TitleSentimentMax       `json:"title_sentiment_max,omitempty" url:"-"`
	ContentSentimentMin     *ContentSentimentMin     `json:"content_sentiment_min,omitempty" url:"-"`
	ContentSentimentMax     *ContentSentimentMax     `json:"content_sentiment_max,omitempty" url:"-"`
	IptcTags                *IptcTags                `json:"iptc_tags,omitempty" url:"-"`
	NotIptcTags             *NotIptcTags             `json:"not_iptc_tags,omitempty" url:"-"`
	CustomTags              *CustomTags              `json:"custom_tags,omitempty" url:"-"`
}

type SearchSimilarPostResponse

type SearchSimilarPostResponse struct {
	SearchSimilarResponseDto       *SearchSimilarResponseDto
	FailedSearchSimilarResponseDto *FailedSearchSimilarResponseDto
	// contains filtered or unexported fields
}

func NewSearchSimilarPostResponseFromFailedSearchSimilarResponseDto added in v1.1.0

func NewSearchSimilarPostResponseFromFailedSearchSimilarResponseDto(value *FailedSearchSimilarResponseDto) *SearchSimilarPostResponse

func NewSearchSimilarPostResponseFromSearchSimilarResponseDto added in v1.1.0

func NewSearchSimilarPostResponseFromSearchSimilarResponseDto(value *SearchSimilarResponseDto) *SearchSimilarPostResponse

func (*SearchSimilarPostResponse) Accept

func (*SearchSimilarPostResponse) GetFailedSearchSimilarResponseDto added in v1.1.0

func (s *SearchSimilarPostResponse) GetFailedSearchSimilarResponseDto() *FailedSearchSimilarResponseDto

func (*SearchSimilarPostResponse) GetSearchSimilarResponseDto added in v1.1.0

func (s *SearchSimilarPostResponse) GetSearchSimilarResponseDto() *SearchSimilarResponseDto

func (SearchSimilarPostResponse) MarshalJSON

func (s SearchSimilarPostResponse) MarshalJSON() ([]byte, error)

func (*SearchSimilarPostResponse) UnmarshalJSON

func (s *SearchSimilarPostResponse) UnmarshalJSON(data []byte) error

type SearchSimilarPostResponseVisitor

type SearchSimilarPostResponseVisitor interface {
	VisitSearchSimilarResponseDto(*SearchSimilarResponseDto) error
	VisitFailedSearchSimilarResponseDto(*FailedSearchSimilarResponseDto) error
}

type SearchSimilarResponseDto added in v1.1.0

type SearchSimilarResponseDto struct {
	// The status of the response.
	Status string `json:"status" url:"status"`
	// The total number of articles matching the search criteria.
	TotalHits int `json:"total_hits" url:"total_hits"`
	// The current page number of the results.
	Page int `json:"page" url:"page"`
	// The total number of pages available for the given search criteria.
	TotalPages int `json:"total_pages" url:"total_pages"`
	// The number of articles per page.
	PageSize int `json:"page_size" url:"page_size"`
	// A list of articles matching the search criteria.
	Articles  []*SimilarArticleEntity `json:"articles,omitempty" url:"articles,omitempty"`
	UserInput *UserInputDto           `json:"user_input,omitempty" url:"user_input,omitempty"`
	// contains filtered or unexported fields
}

The response model for a successful `Search similar` request. Response field behavior: - Required fields are guaranteed to be present and non-null. - Optional fields may be `null`/`undefined` if the data couldn't be extracted during processing. - To access article properties in the `articles` response array, use array index notation. For example, `articles[n].title`, where `n` is the zero-based index of the article object (0, 1, 2, etc.). - The `nlp` property within the article object `articles[n].nlp` is only available with NLP-enabled subscription plans.

func (*SearchSimilarResponseDto) GetArticles added in v1.1.0

func (s *SearchSimilarResponseDto) GetArticles() []*SimilarArticleEntity

func (*SearchSimilarResponseDto) GetExtraProperties added in v1.1.0

func (s *SearchSimilarResponseDto) GetExtraProperties() map[string]interface{}

func (*SearchSimilarResponseDto) GetPage added in v1.1.0

func (s *SearchSimilarResponseDto) GetPage() int

func (*SearchSimilarResponseDto) GetPageSize added in v1.1.0

func (s *SearchSimilarResponseDto) GetPageSize() int

func (*SearchSimilarResponseDto) GetStatus added in v1.1.0

func (s *SearchSimilarResponseDto) GetStatus() string

func (*SearchSimilarResponseDto) GetTotalHits added in v1.1.0

func (s *SearchSimilarResponseDto) GetTotalHits() int

func (*SearchSimilarResponseDto) GetTotalPages added in v1.1.0

func (s *SearchSimilarResponseDto) GetTotalPages() int

func (*SearchSimilarResponseDto) GetUserInput added in v1.1.0

func (s *SearchSimilarResponseDto) GetUserInput() *UserInputDto

func (*SearchSimilarResponseDto) String added in v1.1.0

func (s *SearchSimilarResponseDto) String() string

func (*SearchSimilarResponseDto) UnmarshalJSON added in v1.1.0

func (s *SearchSimilarResponseDto) UnmarshalJSON(data []byte) error

type SearchUrlGetRequest

type SearchUrlGetRequest struct {
	// The Newscatcher article ID (corresponds to the `_id` field in API response) or a list of article IDs to search for. To specify multiple IDs, use a comma-separated string.
	//
	// Example: `"1234567890abcdef, abcdef1234567890"`
	//
	// **Caution**: You can use either the `links` or the `ids` parameter, but not both at the same time.
	Ids *string `json:"-" url:"ids,omitempty"`
	// The article link or list of article links to search for. To specify multiple links, use a comma-separated string.
	//
	// Example: `"https://example.com/article1, https://example.com/article2"`
	//
	// **Caution**: You can use either the `links` or the `ids` parameter, but not both at the same time.
	Links *string `json:"-" url:"links,omitempty"`
	From  *From   `json:"-" url:"from_,omitempty"`
	To    *To     `json:"-" url:"to_,omitempty"`
	// The page number to scroll through the results. Use for pagination, as a single API response can return up to 1,000 articles.
	//
	// For details, see [How to paginate large datasets](https://www.newscatcherapi.com/docs/v3/documentation/how-to/paginate-large-datasets).
	Page *int `json:"-" url:"page,omitempty"`
	// The number of articles to return per page.
	PageSize *int `json:"-" url:"page_size,omitempty"`
}

type SearchUrlPostRequest added in v1.1.0

type SearchUrlPostRequest struct {
	Ids   *Ids   `json:"ids,omitempty" url:"-"`
	Links *Links `json:"links,omitempty" url:"-"`
	// The starting point in time to search from. Accepts date-time strings in ISO 8601 format and plain text strings. The default time zone is UTC.
	//
	// Formats with examples:
	// - YYYY-mm-ddTHH:MM:SS: `2024-07-01T00:00:00`
	// - YYYY-MM-dd: `2024-07-01`
	// - YYYY/mm/dd HH:MM:SS: `2024/07/01 00:00:00`
	// - YYYY/mm/dd: `2024/07/01`
	// - English phrases: `1 day ago`, `today`
	From *From `json:"from_,omitempty" url:"-"`
	// The ending point in time to search up to. Accepts date-time strings in ISO 8601 format and plain text strings. The default time zone is UTC.
	//
	// Formats with examples:
	// - YYYY-mm-ddTHH:MM:SS: `2024-07-01T00:00:00`
	// - YYYY-MM-dd: `2024-07-01`
	// - YYYY/mm/dd HH:MM:SS: `2024/07/01 00:00:00`
	// - YYYY/mm/dd: `2024/07/01`
	// - English phrases: `1 day ago`, `today`
	To       *To       `json:"to_,omitempty" url:"-"`
	Page     *Page     `json:"page,omitempty" url:"-"`
	PageSize *PageSize `json:"page_size,omitempty" url:"-"`
}

type SentimentScores added in v1.1.0

type SentimentScores struct {
	// The sentiment score for the article title (-1.0 to 1.0).
	Title *float64 `json:"title,omitempty" url:"title,omitempty"`
	// The sentiment score for the article content (-1.0 to 1.0).
	Content *float64 `json:"content,omitempty" url:"content,omitempty"`
	// contains filtered or unexported fields
}

Sentiment scores for the article's title and content.

func (*SentimentScores) GetContent added in v1.1.0

func (s *SentimentScores) GetContent() *float64

func (*SentimentScores) GetExtraProperties added in v1.1.0

func (s *SentimentScores) GetExtraProperties() map[string]interface{}

func (*SentimentScores) GetTitle added in v1.1.0

func (s *SentimentScores) GetTitle() *float64

func (*SentimentScores) String added in v1.1.0

func (s *SentimentScores) String() string

func (*SentimentScores) UnmarshalJSON added in v1.1.0

func (s *SentimentScores) UnmarshalJSON(data []byte) error

type SimilarArticleEntity added in v1.1.0

type SimilarArticleEntity struct {
	// The title of the article.
	Title string `json:"title" url:"title"`
	// The primary author of the article.
	Author *string `json:"author,omitempty" url:"author,omitempty"`
	// A list of authors of the article.
	Authors *Authors `json:"authors,omitempty" url:"authors,omitempty"`
	// A list of journalists associated with the article.
	Journalists *Journalists `json:"journalists,omitempty" url:"journalists,omitempty"`
	// The date the article was published.
	PublishedDate *string `json:"published_date,omitempty" url:"published_date,omitempty"`
	// The precision of the published date.
	PublishedDatePrecision *string `json:"published_date_precision,omitempty" url:"published_date_precision,omitempty"`
	// The date the article was last updated.
	UpdatedDate *string `json:"updated_date,omitempty" url:"updated_date,omitempty"`
	// The precision of the updated date.
	UpdatedDatePrecision *string `json:"updated_date_precision,omitempty" url:"updated_date_precision,omitempty"`
	// The date the article was parsed.
	ParseDate *string `json:"parse_date,omitempty" url:"parse_date,omitempty"`
	// The URL link to the article.
	Link string `json:"link" url:"link"`
	// The domain URL of the article.
	DomainUrl string `json:"domain_url" url:"domain_url"`
	// The full domain URL of the article.
	FullDomainUrl string `json:"full_domain_url" url:"full_domain_url"`
	// The name of the source where the article was published.
	NameSource *string `json:"name_source,omitempty" url:"name_source,omitempty"`
	// Indicates if the article is a headline.
	IsHeadline *bool `json:"is_headline,omitempty" url:"is_headline,omitempty"`
	// Indicates if the article is paid content.
	PaidContent *bool `json:"paid_content,omitempty" url:"paid_content,omitempty"`
	// The categorical URL of the article.
	ParentUrl string `json:"parent_url" url:"parent_url"`
	// The country where the article was published.
	Country *string `json:"country,omitempty" url:"country,omitempty"`
	// The rights information for the article.
	Rights *string `json:"rights,omitempty" url:"rights,omitempty"`
	// The rank of the article's source.
	Rank int `json:"rank" url:"rank"`
	// The media associated with the article.
	Media *string `json:"media,omitempty" url:"media,omitempty"`
	// The language in which the article is written.
	Language *string `json:"language,omitempty" url:"language,omitempty"`
	// A brief description of the article.
	Description *string `json:"description,omitempty" url:"description,omitempty"`
	// The content of the article.
	Content string `json:"content" url:"content"`
	// The word count of the article.
	WordCount *int `json:"word_count,omitempty" url:"word_count,omitempty"`
	// Indicates if the article is an opinion piece.
	IsOpinion *bool `json:"is_opinion,omitempty" url:"is_opinion,omitempty"`
	// The Twitter account associated with the article.
	TwitterAccount *string `json:"twitter_account,omitempty" url:"twitter_account,omitempty"`
	// A list of all URLs mentioned in the article.
	AllLinks *ArticleEntityAllLinks `json:"all_links,omitempty" url:"all_links,omitempty"`
	// A list of all domain URLs mentioned in the article.
	AllDomainLinks *ArticleEntityAllDomainLinks `json:"all_domain_links,omitempty" url:"all_domain_links,omitempty"`
	Nlp            *NlpDataEntity               `json:"nlp,omitempty" url:"nlp,omitempty"`
	// The unique identifier for the article.
	Id string `json:"id" url:"id"`
	// The relevance score of the article.
	Score float64 `json:"score" url:"score"`
	// An object that contains custom tags associated with an article, where each key is a taxonomy name, and the value is an array of tags.
	CustomTags           map[string][]string         `json:"custom_tags,omitempty" url:"custom_tags,omitempty"`
	AdditionalDomainInfo *AdditionalDomainInfoEntity `json:"additional_domain_info,omitempty" url:"additional_domain_info,omitempty"`
	// A list of documents similar to the article.
	SimilarDocuments []*SimilarDocument `json:"similar_documents,omitempty" url:"similar_documents,omitempty"`
	// contains filtered or unexported fields
}

The data model for an article result in the `Search similar` articles request. Response field behavior: - Required fields are guaranteed to be present and non-null. - Optional fields may be `null`/`undefined` if the data couldn't be extracted during processing.

func (*SimilarArticleEntity) GetAdditionalDomainInfo added in v1.1.0

func (s *SimilarArticleEntity) GetAdditionalDomainInfo() *AdditionalDomainInfoEntity
func (s *SimilarArticleEntity) GetAllDomainLinks() *ArticleEntityAllDomainLinks
func (s *SimilarArticleEntity) GetAllLinks() *ArticleEntityAllLinks

func (*SimilarArticleEntity) GetAuthor added in v1.1.0

func (s *SimilarArticleEntity) GetAuthor() *string

func (*SimilarArticleEntity) GetAuthors added in v1.1.0

func (s *SimilarArticleEntity) GetAuthors() *Authors

func (*SimilarArticleEntity) GetContent added in v1.1.0

func (s *SimilarArticleEntity) GetContent() string

func (*SimilarArticleEntity) GetCountry added in v1.1.0

func (s *SimilarArticleEntity) GetCountry() *string

func (*SimilarArticleEntity) GetCustomTags added in v1.1.0

func (s *SimilarArticleEntity) GetCustomTags() map[string][]string

func (*SimilarArticleEntity) GetDescription added in v1.1.0

func (s *SimilarArticleEntity) GetDescription() *string

func (*SimilarArticleEntity) GetDomainUrl added in v1.1.0

func (s *SimilarArticleEntity) GetDomainUrl() string

func (*SimilarArticleEntity) GetExtraProperties added in v1.1.0

func (s *SimilarArticleEntity) GetExtraProperties() map[string]interface{}

func (*SimilarArticleEntity) GetFullDomainUrl added in v1.1.0

func (s *SimilarArticleEntity) GetFullDomainUrl() string

func (*SimilarArticleEntity) GetId added in v1.1.0

func (s *SimilarArticleEntity) GetId() string

func (*SimilarArticleEntity) GetIsHeadline added in v1.1.0

func (s *SimilarArticleEntity) GetIsHeadline() *bool

func (*SimilarArticleEntity) GetIsOpinion added in v1.1.0

func (s *SimilarArticleEntity) GetIsOpinion() *bool

func (*SimilarArticleEntity) GetJournalists added in v1.1.0

func (s *SimilarArticleEntity) GetJournalists() *Journalists

func (*SimilarArticleEntity) GetLanguage added in v1.1.0

func (s *SimilarArticleEntity) GetLanguage() *string
func (s *SimilarArticleEntity) GetLink() string

func (*SimilarArticleEntity) GetMedia added in v1.1.0

func (s *SimilarArticleEntity) GetMedia() *string

func (*SimilarArticleEntity) GetNameSource added in v1.1.0

func (s *SimilarArticleEntity) GetNameSource() *string

func (*SimilarArticleEntity) GetNlp added in v1.1.0

func (s *SimilarArticleEntity) GetNlp() *NlpDataEntity

func (*SimilarArticleEntity) GetPaidContent added in v1.1.0

func (s *SimilarArticleEntity) GetPaidContent() *bool

func (*SimilarArticleEntity) GetParentUrl added in v1.1.0

func (s *SimilarArticleEntity) GetParentUrl() string

func (*SimilarArticleEntity) GetParseDate added in v1.1.0

func (s *SimilarArticleEntity) GetParseDate() *string

func (*SimilarArticleEntity) GetPublishedDate added in v1.1.0

func (s *SimilarArticleEntity) GetPublishedDate() *string

func (*SimilarArticleEntity) GetPublishedDatePrecision added in v1.1.0

func (s *SimilarArticleEntity) GetPublishedDatePrecision() *string

func (*SimilarArticleEntity) GetRank added in v1.1.0

func (s *SimilarArticleEntity) GetRank() int

func (*SimilarArticleEntity) GetRights added in v1.1.0

func (s *SimilarArticleEntity) GetRights() *string

func (*SimilarArticleEntity) GetScore added in v1.1.0

func (s *SimilarArticleEntity) GetScore() float64

func (*SimilarArticleEntity) GetSimilarDocuments added in v1.1.0

func (s *SimilarArticleEntity) GetSimilarDocuments() []*SimilarDocument

func (*SimilarArticleEntity) GetTitle added in v1.1.0

func (s *SimilarArticleEntity) GetTitle() string

func (*SimilarArticleEntity) GetTwitterAccount added in v1.1.0

func (s *SimilarArticleEntity) GetTwitterAccount() *string

func (*SimilarArticleEntity) GetUpdatedDate added in v1.1.0

func (s *SimilarArticleEntity) GetUpdatedDate() *string

func (*SimilarArticleEntity) GetUpdatedDatePrecision added in v1.1.0

func (s *SimilarArticleEntity) GetUpdatedDatePrecision() *string

func (*SimilarArticleEntity) GetWordCount added in v1.1.0

func (s *SimilarArticleEntity) GetWordCount() *int

func (*SimilarArticleEntity) String added in v1.1.0

func (s *SimilarArticleEntity) String() string

func (*SimilarArticleEntity) UnmarshalJSON added in v1.1.0

func (s *SimilarArticleEntity) UnmarshalJSON(data []byte) error

type SimilarDocument

type SimilarDocument struct {
	// The unique identifier of the similar document.
	Id string `json:"id" url:"id"`
	// The relevance score of the similar document.
	Score float64 `json:"score" url:"score"`
	// The title of the similar document.
	Title string `json:"title" url:"title"`
	// The link to the similar document.
	Link string `json:"link" url:"link"`
	// contains filtered or unexported fields
}

The data model for a similar document in the `Search similar` articles request.

func (*SimilarDocument) GetExtraProperties

func (s *SimilarDocument) GetExtraProperties() map[string]interface{}

func (*SimilarDocument) GetId

func (s *SimilarDocument) GetId() string
func (s *SimilarDocument) GetLink() string

func (*SimilarDocument) GetScore

func (s *SimilarDocument) GetScore() float64

func (*SimilarDocument) GetTitle

func (s *SimilarDocument) GetTitle() string

func (*SimilarDocument) String

func (s *SimilarDocument) String() string

func (*SimilarDocument) UnmarshalJSON

func (s *SimilarDocument) UnmarshalJSON(data []byte) error

type SimilarDocumentsFields added in v1.1.0

type SimilarDocumentsFields = string

The fields to consider for finding similar documents.

type SimilarDocumentsNumber added in v1.1.0

type SimilarDocumentsNumber = int

The number of similar documents to return.

type SortBy added in v1.1.0

type SortBy string

The sorting order of the results. Possible values are: - `relevancy`: The most relevant results first. - `date`: The most recently published results first. - `rank`: The results from the highest-ranked sources first.

const (
	SortByRelevancy SortBy = "relevancy"
	SortByDate      SortBy = "date"
	SortByRank      SortBy = "rank"
)

func NewSortByFromString added in v1.1.0

func NewSortByFromString(s string) (SortBy, error)

func (SortBy) Ptr added in v1.1.0

func (s SortBy) Ptr() *SortBy

type SourceInfo

type SourceInfo struct {
	// The name of the news source.
	NameSource *string `json:"name_source,omitempty" url:"name_source,omitempty"`
	// The domain URL of the news source.
	DomainUrl string `json:"domain_url" url:"domain_url"`
	// The logo of the news source.
	AdditionalInfo *AdditionalSourceInfo `json:"additional_info,omitempty" url:"additional_info,omitempty"`
	// contains filtered or unexported fields
}

The data model for information about a news source.

func (*SourceInfo) GetAdditionalInfo

func (s *SourceInfo) GetAdditionalInfo() *AdditionalSourceInfo

func (*SourceInfo) GetDomainUrl

func (s *SourceInfo) GetDomainUrl() string

func (*SourceInfo) GetExtraProperties

func (s *SourceInfo) GetExtraProperties() map[string]interface{}
func (s *SourceInfo) GetLogo() *string

func (*SourceInfo) GetNameSource

func (s *SourceInfo) GetNameSource() *string

func (*SourceInfo) String

func (s *SourceInfo) String() string

func (*SourceInfo) UnmarshalJSON

func (s *SourceInfo) UnmarshalJSON(data []byte) error

type SourceName added in v1.1.0

type SourceName struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

Specifies terms to search within the source names. To specify multiple terms, use a comma-separated string or an array of strings.

Examples: - `"sport, tech"` - `["sport", "tech"]`

**Note**: The search does not require an exact match and returns all sources that include the specified terms anywhere in their names. You can use any word, phrase, or outlet name, such as `"sport"`, or `"new york times"`. For example, using `"sport"` as a term returns sources like `"Motorsport"`, `"Dot Esport"`, and `"Tuttosport"`.

func NewSourceNameFromString added in v1.1.0

func NewSourceNameFromString(value string) *SourceName

func NewSourceNameFromStringList added in v1.1.0

func NewSourceNameFromStringList(value []string) *SourceName

func (*SourceName) Accept added in v1.1.0

func (s *SourceName) Accept(visitor SourceNameVisitor) error

func (*SourceName) GetString added in v1.1.0

func (s *SourceName) GetString() string

func (*SourceName) GetStringList added in v1.1.0

func (s *SourceName) GetStringList() []string

func (SourceName) MarshalJSON added in v1.1.0

func (s SourceName) MarshalJSON() ([]byte, error)

func (*SourceName) UnmarshalJSON added in v1.1.0

func (s *SourceName) UnmarshalJSON(data []byte) error

type SourceNameVisitor added in v1.1.0

type SourceNameVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}

type SourceUrl added in v1.1.0

type SourceUrl struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

The domains of the news publication to search for. To specify multiple news sources, use a comma-separated string or an array of strings.

Examples: - `"bbc.com, nytimes.com"` - `["bbc.com", "nytimes.com"]`

**Caution**: When specifying the `source_url` parameter, you can only use `include_additional_info` as an extra parameter.

func NewSourceUrlFromString added in v1.1.0

func NewSourceUrlFromString(value string) *SourceUrl

func NewSourceUrlFromStringList added in v1.1.0

func NewSourceUrlFromStringList(value []string) *SourceUrl

func (*SourceUrl) Accept added in v1.1.0

func (s *SourceUrl) Accept(visitor SourceUrlVisitor) error

func (*SourceUrl) GetString added in v1.1.0

func (s *SourceUrl) GetString() string

func (*SourceUrl) GetStringList added in v1.1.0

func (s *SourceUrl) GetStringList() []string

func (SourceUrl) MarshalJSON added in v1.1.0

func (s SourceUrl) MarshalJSON() ([]byte, error)

func (*SourceUrl) UnmarshalJSON added in v1.1.0

func (s *SourceUrl) UnmarshalJSON(data []byte) error

type SourceUrlVisitor added in v1.1.0

type SourceUrlVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}

type Sources added in v1.1.0

type Sources struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

One or more news sources to narrow down the search. The format must be a domain URL. Subdomains, such as `finance.yahoo.com`, are also acceptable. To specify multiple sources, use a comma-separated string or an array of strings.

Examples: - `"nytimes.com, theguardian.com"` - `["nytimes.com", "theguardian.com"]`

func NewSourcesFromString added in v1.1.0

func NewSourcesFromString(value string) *Sources

func NewSourcesFromStringList added in v1.1.0

func NewSourcesFromStringList(value []string) *Sources

func (*Sources) Accept added in v1.1.0

func (s *Sources) Accept(visitor SourcesVisitor) error

func (*Sources) GetString added in v1.1.0

func (s *Sources) GetString() string

func (*Sources) GetStringList added in v1.1.0

func (s *Sources) GetStringList() []string

func (Sources) MarshalJSON added in v1.1.0

func (s Sources) MarshalJSON() ([]byte, error)

func (*Sources) UnmarshalJSON added in v1.1.0

func (s *Sources) UnmarshalJSON(data []byte) error

type SourcesGetRequest

type SourcesGetRequest struct {
	// The language(s) of the search. The only accepted format is the two-letter [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) code. To select multiple languages, use a comma-separated string.
	//
	// Example: `"en, es"`
	//
	// To learn more, see [Enumerated parameters > Language](/docs/v3/api-reference/overview/enumerated-parameters#language-lang-and-not-lang).
	Lang *string `json:"-" url:"lang,omitempty"`
	// The countries where the news publisher is located. The accepted format is the two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code. To select multiple countries, use a comma-separated string.
	//
	// Example: `"US, CA"`
	//
	// To learn more, see [Enumerated parameters > Country](/docs/v3/api-reference/overview/enumerated-parameters#country-country-and-not-country).
	Countries *string `json:"-" url:"countries,omitempty"`
	// Predefined top news sources per country.
	//
	// Format: start with the word `top`, followed by the number of desired sources, and then the two-letter country code [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). Multiple countries with the number of top sources can be specified as a comma-separated string.
	//
	// Examples:
	// - `"top 100 US"`
	// - `"top 33 AT"`
	// - `"top 50 US, top 20 GB"`
	// - `"top 33 AT, top 50 IT"`
	PredefinedSources *string `json:"-" url:"predefined_sources,omitempty"`
	// Word or phrase to search within the source names. To specify multiple values, use a comma-separated string.
	//
	// Example: `"sport, tech"`
	//
	// **Note**: The search doesn't require an exact match and returns sources containing the specified terms in their names. You can use any word or phrase, like `"sport"` or `"new york times"`. For example, `"sport"` returns sources such as `"Motorsport"`, `"Dot Esport"`, and `"Tuttosport"`.
	SourceName *string `json:"-" url:"source_name,omitempty"`
	// The domain(s) of the news publication to search for.
	//
	// **Caution**:  When specifying the `source_url` parameter,
	// you can only use `include_additional_info` as an extra parameter.
	SourceUrl *string `json:"-" url:"source_url,omitempty"`
	// If true, returns the following additional datapoints about each news source:
	// - `nb_articles_for_7d`: The number of articles published by the source in the last week.
	// - `country`: Source country of origin.
	// - `rank`: SEO rank.
	// - `is_news_domain`: Boolean indicating if the source is a news domain.
	// - `news_domain_type`: Type of news domain (e.g., "Original Content").
	// - `news_type`: Category of news (e.g., "General News Outlets").
	IncludeAdditionalInfo *bool `json:"-" url:"include_additional_info,omitempty"`
	// If true, filters results to include only news domains.
	IsNewsDomain *bool `json:"-" url:"is_news_domain,omitempty"`
	// Filters results based on the news domain type. Possible values are:
	// - `Original Content`: Sources that produce their own content.
	// - `Aggregator`: Sources that collect content from various other sources.
	// - `Press Releases`: Sources primarily publishing press releases.
	// - `Republisher`: Sources that republish content from other sources.
	// - `Other`: Sources that don't fit into main categories.
	NewsDomainType *SourcesGetRequestNewsDomainType `json:"-" url:"news_domain_type,omitempty"`
	// Filters results based on the news type. Multiple types can be specified using a comma-separated string.
	//
	// Example: `"General News Outlets,Tech News and Updates"`
	//
	// For a complete list of available news types, see [Enumerated parameters > News type](/docs/v3/api-reference/overview/enumerated-parameters#news-type-news-type).
	NewsType *string `json:"-" url:"news_type,omitempty"`
	// The lowest boundary of the rank of a news website to filter by. A lower rank indicates a more popular source.
	FromRank *int `json:"-" url:"from_rank,omitempty"`
	// The highest boundary of the rank of a news website to filter by. A lower rank indicates a more popular source.
	ToRank *int `json:"-" url:"to_rank,omitempty"`
}

type SourcesGetRequestNewsDomainType added in v1.1.0

type SourcesGetRequestNewsDomainType string
const (
	SourcesGetRequestNewsDomainTypeOriginalContent SourcesGetRequestNewsDomainType = "Original Content"
	SourcesGetRequestNewsDomainTypeAggregator      SourcesGetRequestNewsDomainType = "Aggregator"
	SourcesGetRequestNewsDomainTypePressReleases   SourcesGetRequestNewsDomainType = "Press Releases"
	SourcesGetRequestNewsDomainTypeRepublisher     SourcesGetRequestNewsDomainType = "Republisher"
	SourcesGetRequestNewsDomainTypeOther           SourcesGetRequestNewsDomainType = "Other"
)

func NewSourcesGetRequestNewsDomainTypeFromString added in v1.1.0

func NewSourcesGetRequestNewsDomainTypeFromString(s string) (SourcesGetRequestNewsDomainType, error)

func (SourcesGetRequestNewsDomainType) Ptr added in v1.1.0

type SourcesPostRequest added in v1.1.0

type SourcesPostRequest struct {
	Lang                  *Lang                  `json:"lang,omitempty" url:"-"`
	Countries             *Countries             `json:"countries,omitempty" url:"-"`
	PredefinedSources     *PredefinedSources     `json:"predefined_sources,omitempty" url:"-"`
	SourceName            *SourceName            `json:"source_name,omitempty" url:"-"`
	SourceUrl             *SourceUrl             `json:"source_url,omitempty" url:"-"`
	IncludeAdditionalInfo *IncludeAdditionalInfo `json:"include_additional_info,omitempty" url:"-"`
	IsNewsDomain          *IsNewsDomain          `json:"is_news_domain,omitempty" url:"-"`
	NewsDomainType        *NewsDomainType        `json:"news_domain_type,omitempty" url:"-"`
	NewsType              *NewsType              `json:"news_type,omitempty" url:"-"`
	FromRank              *FromRank              `json:"from_rank,omitempty" url:"-"`
	ToRank                *ToRank                `json:"to_rank,omitempty" url:"-"`
}

type SourcesResponseDto added in v1.1.0

type SourcesResponseDto struct {
	// A message indicating the result of the request.
	Message string `json:"message" url:"message"`
	// A list of news sources that match the specified criteria.
	Sources []*SourcesResponseDtoSourcesItem `json:"sources,omitempty" url:"sources,omitempty"`
	// The user input parameters for the request.
	UserInput map[string]interface{} `json:"user_input,omitempty" url:"user_input,omitempty"`
	// contains filtered or unexported fields
}

The response model for a successful `Sources` request retrieving news sources matching the specified criteria. Response field behavior: - Required fields are guaranteed to be present and non-null. - Optional fields may be `null`/`undefined` if the data couldn't be extracted during processing.

func (*SourcesResponseDto) GetExtraProperties added in v1.1.0

func (s *SourcesResponseDto) GetExtraProperties() map[string]interface{}

func (*SourcesResponseDto) GetMessage added in v1.1.0

func (s *SourcesResponseDto) GetMessage() string

func (*SourcesResponseDto) GetSources added in v1.1.0

func (*SourcesResponseDto) GetUserInput added in v1.1.0

func (s *SourcesResponseDto) GetUserInput() map[string]interface{}

func (*SourcesResponseDto) String added in v1.1.0

func (s *SourcesResponseDto) String() string

func (*SourcesResponseDto) UnmarshalJSON added in v1.1.0

func (s *SourcesResponseDto) UnmarshalJSON(data []byte) error

type SourcesResponseDtoSourcesItem added in v1.1.0

type SourcesResponseDtoSourcesItem struct {
	SourceInfo *SourceInfo
	String     string
	// contains filtered or unexported fields
}

func NewSourcesResponseDtoSourcesItemFromSourceInfo added in v1.1.0

func NewSourcesResponseDtoSourcesItemFromSourceInfo(value *SourceInfo) *SourcesResponseDtoSourcesItem

func NewSourcesResponseDtoSourcesItemFromString added in v1.1.0

func NewSourcesResponseDtoSourcesItemFromString(value string) *SourcesResponseDtoSourcesItem

func (*SourcesResponseDtoSourcesItem) Accept added in v1.1.0

func (*SourcesResponseDtoSourcesItem) GetSourceInfo added in v1.1.0

func (s *SourcesResponseDtoSourcesItem) GetSourceInfo() *SourceInfo

func (*SourcesResponseDtoSourcesItem) GetString added in v1.1.0

func (s *SourcesResponseDtoSourcesItem) GetString() string

func (SourcesResponseDtoSourcesItem) MarshalJSON added in v1.1.0

func (s SourcesResponseDtoSourcesItem) MarshalJSON() ([]byte, error)

func (*SourcesResponseDtoSourcesItem) UnmarshalJSON added in v1.1.0

func (s *SourcesResponseDtoSourcesItem) UnmarshalJSON(data []byte) error

type SourcesResponseDtoSourcesItemVisitor added in v1.1.0

type SourcesResponseDtoSourcesItemVisitor interface {
	VisitSourceInfo(*SourceInfo) error
	VisitString(string) error
}

type SourcesVisitor added in v1.1.0

type SourcesVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}

type SubscriptionResponseDto added in v1.1.0

type SubscriptionResponseDto struct {
	// Indicates whether the subscription is currently active.
	Active bool `json:"active" url:"active"`
	// The number of API calls allowed per second allowed in the current plan.
	ConcurrentCalls int `json:"concurrent_calls" url:"concurrent_calls"`
	// The name of the subscription plan.
	Plan string `json:"plan" url:"plan"`
	// The total number of API calls assigned to the current subscription.
	PlanCalls int `json:"plan_calls" url:"plan_calls"`
	// The number of API calls remaining for the current subscription period.
	RemainingCalls int `json:"remaining_calls" url:"remaining_calls"`
	// The number of historical days accessible under the current subscription plan.
	HistoricalDays int `json:"historical_days" url:"historical_days"`
	// contains filtered or unexported fields
}

Response model for a successful `Subscription` request retrieving plan information. Response field behavior: - Required fields are guaranteed to be present and non-null. - Optional fields may be `null`/`undefined` if the data couldn't be extracted during processing.

func (*SubscriptionResponseDto) GetActive added in v1.1.0

func (s *SubscriptionResponseDto) GetActive() bool

func (*SubscriptionResponseDto) GetConcurrentCalls added in v1.1.0

func (s *SubscriptionResponseDto) GetConcurrentCalls() int

func (*SubscriptionResponseDto) GetExtraProperties added in v1.1.0

func (s *SubscriptionResponseDto) GetExtraProperties() map[string]interface{}

func (*SubscriptionResponseDto) GetHistoricalDays added in v1.1.0

func (s *SubscriptionResponseDto) GetHistoricalDays() int

func (*SubscriptionResponseDto) GetPlan added in v1.1.0

func (s *SubscriptionResponseDto) GetPlan() string

func (*SubscriptionResponseDto) GetPlanCalls added in v1.1.0

func (s *SubscriptionResponseDto) GetPlanCalls() int

func (*SubscriptionResponseDto) GetRemainingCalls added in v1.1.0

func (s *SubscriptionResponseDto) GetRemainingCalls() int

func (*SubscriptionResponseDto) String added in v1.1.0

func (s *SubscriptionResponseDto) String() string

func (*SubscriptionResponseDto) UnmarshalJSON added in v1.1.0

func (s *SubscriptionResponseDto) UnmarshalJSON(data []byte) error

type Theme added in v1.1.0

type Theme struct {
	String     string
	StringList []string
	// contains filtered or unexported fields
}

Filters articles based on their general topic, as determined by NLP analysis. To select multiple themes, use a comma-separated string or an array of strings.

Examples: - `"Finance, Tech"` - `["Finance", "Tech"]`

**Note**: The `theme` parameter is only available if NLP is included in your subscription plan.

To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).

Available options: `Business`, `Economics`, `Entertainment`, `Finance`, `Health`, `Politics`, `Science`, `Sports`, `Tech`, `Crime`, `Financial Crime`, `Lifestyle`, `Automotive`, `Travel`, `Weather`, `General`.

func NewThemeFromString added in v1.1.0

func NewThemeFromString(value string) *Theme

func NewThemeFromStringList added in v1.1.0

func NewThemeFromStringList(value []string) *Theme

func (*Theme) Accept added in v1.1.0

func (t *Theme) Accept(visitor ThemeVisitor) error

func (*Theme) GetString added in v1.1.0

func (t *Theme) GetString() string

func (*Theme) GetStringList added in v1.1.0

func (t *Theme) GetStringList() []string

func (Theme) MarshalJSON added in v1.1.0

func (t Theme) MarshalJSON() ([]byte, error)

func (*Theme) UnmarshalJSON added in v1.1.0

func (t *Theme) UnmarshalJSON(data []byte) error

type ThemeVisitor added in v1.1.0

type ThemeVisitor interface {
	VisitString(string) error
	VisitStringList([]string) error
}

type TimeFrameCount added in v1.1.0

type TimeFrameCount struct {
	// The timestamp for the aggregation period in format "YYYY-MM-DD HH:mm:ss"
	TimeFrame time.Time `json:"time_frame" url:"time_frame"`
	// The number of articles published during this time frame
	ArticleCount int `json:"article_count" url:"article_count"`
	// contains filtered or unexported fields
}

Represents the article count for a specific time frame.

func (*TimeFrameCount) GetArticleCount added in v1.1.0

func (t *TimeFrameCount) GetArticleCount() int

func (*TimeFrameCount) GetExtraProperties added in v1.1.0

func (t *TimeFrameCount) GetExtraProperties() map[string]interface{}

func (*TimeFrameCount) GetTimeFrame added in v1.1.0

func (t *TimeFrameCount) GetTimeFrame() time.Time

func (*TimeFrameCount) MarshalJSON added in v1.1.0

func (t *TimeFrameCount) MarshalJSON() ([]byte, error)

func (*TimeFrameCount) String added in v1.1.0

func (t *TimeFrameCount) String() string

func (*TimeFrameCount) UnmarshalJSON added in v1.1.0

func (t *TimeFrameCount) UnmarshalJSON(data []byte) error

type TitleSentimentMax added in v1.1.0

type TitleSentimentMax = float64

Filters articles based on the maximum sentiment score of their titles.

Range is `-1.0` to `1.0`, where: - Negative values indicate negative sentiment. - Positive values indicate positive sentiment. - Values close to 0 indicate neutral sentiment.

**Note**: The `title_sentiment_max` parameter is only available if NLP is included in your subscription plan.

To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).

type TitleSentimentMin added in v1.1.0

type TitleSentimentMin = float64

Filters articles based on the minimum sentiment score of their titles.

Range is `-1.0` to `1.0`, where: - Negative values indicate negative sentiment. - Positive values indicate positive sentiment. - Values close to 0 indicate neutral sentiment.

**Note**: The `title_sentiment_min` parameter is only available if NLP is included in your subscription plan.

To learn more, see [NLP features](/docs/v3/documentation/guides-and-concepts/nlp-features).

type To added in v1.1.0

type To struct {
	DateTime time.Time
	String   string
	// contains filtered or unexported fields
}

The ending point in time to search up to. Accepts date-time strings in ISO 8601 format and plain text strings. The default time zone is UTC.

Formats with examples: - YYYY-mm-ddTHH:MM:SS: `2024-07-01T00:00:00` - YYYY-MM-dd: `2024-07-01` - YYYY/mm/dd HH:MM:SS: `2024/07/01 00:00:00` - YYYY/mm/dd: `2024/07/01` - English phrases: `1 day ago`, `today`

**Note**: By default, applied to the publication date of the article. To use the article's parse date instead, set the `by_parse_date` parameter to `true`.

func NewToFromDateTime added in v1.1.0

func NewToFromDateTime(value time.Time) *To

func NewToFromString added in v1.1.0

func NewToFromString(value string) *To

func (*To) Accept added in v1.1.0

func (t *To) Accept(visitor ToVisitor) error

func (*To) GetDateTime added in v1.1.0

func (t *To) GetDateTime() time.Time

func (*To) GetString added in v1.1.0

func (t *To) GetString() string

func (To) MarshalJSON added in v1.1.0

func (t To) MarshalJSON() ([]byte, error)

func (*To) UnmarshalJSON added in v1.1.0

func (t *To) UnmarshalJSON(data []byte) error

type ToRank added in v1.1.0

type ToRank = int

The highest boundary of the rank of a news website to filter by. A lower rank indicates a more popular source.

type ToVisitor added in v1.1.0

type ToVisitor interface {
	VisitDateTime(time.Time) error
	VisitString(string) error
}

type TooManyRequestsError added in v1.1.0

type TooManyRequestsError struct {
	*core.APIError
	Body *Error
}

Too many requests - Rate limit exceeded

func (*TooManyRequestsError) MarshalJSON added in v1.1.0

func (t *TooManyRequestsError) MarshalJSON() ([]byte, error)

func (*TooManyRequestsError) UnmarshalJSON added in v1.1.0

func (t *TooManyRequestsError) UnmarshalJSON(data []byte) error

func (*TooManyRequestsError) Unwrap added in v1.1.0

func (t *TooManyRequestsError) Unwrap() error

type UnauthorizedError added in v1.1.0

type UnauthorizedError struct {
	*core.APIError
	Body *Error
}

Unauthorized - Authentication failed

func (*UnauthorizedError) MarshalJSON added in v1.1.0

func (u *UnauthorizedError) MarshalJSON() ([]byte, error)

func (*UnauthorizedError) UnmarshalJSON added in v1.1.0

func (u *UnauthorizedError) UnmarshalJSON(data []byte) error

func (*UnauthorizedError) Unwrap added in v1.1.0

func (u *UnauthorizedError) Unwrap() error

type UnprocessableEntityError

type UnprocessableEntityError struct {
	*core.APIError
	Body *Error
}

Validation error

func (*UnprocessableEntityError) MarshalJSON

func (u *UnprocessableEntityError) MarshalJSON() ([]byte, error)

func (*UnprocessableEntityError) UnmarshalJSON

func (u *UnprocessableEntityError) UnmarshalJSON(data []byte) error

func (*UnprocessableEntityError) Unwrap

func (u *UnprocessableEntityError) Unwrap() error

type UserInputDto added in v1.1.0

type UserInputDto = map[string]interface{}

The user input parameters for the request.

type When added in v1.1.0

type When = string

The time period for which you want to get the latest headlines.

Format examples: - `7d`: Last seven days - `30d`: Last 30 days - `1h`: Last hour - `24h`: Last 24 hours

type WordCountMax added in v1.1.0

type WordCountMax = int

The maximum number of words an article can contain. To be used for avoiding articles with large content.

type WordCountMin added in v1.1.0

type WordCountMin = int

The minimum number of words an article must contain. To be used for avoiding articles with small content.

Directories

Path Synopsis
Operations to aggregate news counts.
Operations to aggregate news counts.
Operations to search by author.
Operations to search by author.
Operations to retrieve latest headlines.
Operations to retrieve latest headlines.
Operations to search for articles.
Operations to search for articles.
Operations to search by link or ID.
Operations to search by link or ID.
Operations to find similar articles.
Operations to find similar articles.
Operations to retrieve news sources.
Operations to retrieve news sources.
Operations to get subscription info.
Operations to get subscription info.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL