Class: ContextDev::Resources::News

Inherits:
Object
  • Object
show all
Defined in:
lib/context_dev/resources/news.rb,
sig/context_dev/resources/news.rbs

Overview

Search live first-party RSS and free historical news data by company identity.

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ News

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of News.

Parameters:



46
47
48
# File 'lib/context_dev/resources/news.rb', line 46

def initialize(client:)
  @client = client
end

Instance Method Details

#search(search_by:, cursor: nil, filter_by: nil, limit: nil, sort_by: nil, tags: nil, request_options: {}) ⇒ ContextDev::Models::NewsSearchResponse

Searches live and historical company news for one company, identified in searchBy by name, domain, ticker (optionally disambiguated by exchange), or ISIN. Results can be filtered by publisher domain, publisher country, article language, article type, and published-at date, and include stable story IDs, source metadata, verified entity relevance, and cursor pagination.

Parameters:

Returns:

See Also:



32
33
34
35
36
37
38
39
40
41
# File 'lib/context_dev/resources/news.rb', line 32

def search(params)
  parsed, options = ContextDev::NewsSearchParams.dump_request(params)
  @client.request(
    method: :post,
    path: "news/search",
    body: parsed,
    model: ContextDev::Models::NewsSearchResponse,
    options: options
  )
end