Skip to content

Latest commit

 

History

History
173 lines (128 loc) · 4.45 KB

File metadata and controls

173 lines (128 loc) · 4.45 KB

Zernio::RedditSearchApi

All URIs are relative to https://zernio.com/api

Method HTTP request Description
get_reddit_feed GET /v1/reddit/feed Get subreddit feed
search_reddit GET /v1/reddit/search Search posts

get_reddit_feed

get_reddit_feed(account_id, opts)

Get subreddit feed

Fetch posts from a subreddit feed. Supports sorting, time filtering, and cursor-based pagination.

Examples

require 'time'
require 'zernio-sdk'
# setup authorization
Zernio.configure do |config|
  # Configure Bearer authorization (JWT): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = Zernio::RedditSearchApi.new
account_id = 'account_id_example' # String | 
opts = {
  subreddit: 'subreddit_example', # String | 
  sort: 'hot', # String | 
  limit: 56, # Integer | 
  after: 'after_example', # String | 
  t: 'hour' # String | 
}

begin
  # Get subreddit feed
  result = api_instance.get_reddit_feed(account_id, opts)
  p result
rescue Zernio::ApiError => e
  puts "Error when calling RedditSearchApi->get_reddit_feed: #{e}"
end

Using the get_reddit_feed_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> get_reddit_feed_with_http_info(account_id, opts)

begin
  # Get subreddit feed
  data, status_code, headers = api_instance.get_reddit_feed_with_http_info(account_id, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <SearchReddit200Response>
rescue Zernio::ApiError => e
  puts "Error when calling RedditSearchApi->get_reddit_feed_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
account_id String
subreddit String [optional]
sort String [optional][default to 'hot']
limit Integer [optional][default to 25]
after String [optional]
t String [optional]

Return type

SearchReddit200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

search_reddit

search_reddit(account_id, q, opts)

Search posts

Search Reddit posts using a connected account. Optionally scope to a specific subreddit.

Examples

require 'time'
require 'zernio-sdk'
# setup authorization
Zernio.configure do |config|
  # Configure Bearer authorization (JWT): bearerAuth
  config.access_token = 'YOUR_BEARER_TOKEN'
end

api_instance = Zernio::RedditSearchApi.new
account_id = 'account_id_example' # String | 
q = 'q_example' # String | 
opts = {
  subreddit: 'subreddit_example', # String | 
  restrict_sr: '0', # String | 
  sort: 'relevance', # String | 
  limit: 56, # Integer | 
  after: 'after_example' # String | 
}

begin
  # Search posts
  result = api_instance.search_reddit(account_id, q, opts)
  p result
rescue Zernio::ApiError => e
  puts "Error when calling RedditSearchApi->search_reddit: #{e}"
end

Using the search_reddit_with_http_info variant

This returns an Array which contains the response data, status code and headers.

<Array(, Integer, Hash)> search_reddit_with_http_info(account_id, q, opts)

begin
  # Search posts
  data, status_code, headers = api_instance.search_reddit_with_http_info(account_id, q, opts)
  p status_code # => 2xx
  p headers # => { ... }
  p data # => <SearchReddit200Response>
rescue Zernio::ApiError => e
  puts "Error when calling RedditSearchApi->search_reddit_with_http_info: #{e}"
end

Parameters

Name Type Description Notes
account_id String
q String
subreddit String [optional]
restrict_sr String [optional]
sort String [optional][default to 'new']
limit Integer [optional][default to 25]
after String [optional]

Return type

SearchReddit200Response

Authorization

bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json