Skip to content

Latest commit

 

History

History
750 lines (597 loc) · 24.5 KB

File metadata and controls

750 lines (597 loc) · 24.5 KB

RedditApi

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

Method HTTP request Description
redditFeedHomeGet GET /reddit/feed/home Browse Reddit's anonymous home feed
redditFeedNewsGet GET /reddit/feed/news Browse Reddit's news feed
redditFeedPopularGet GET /reddit/feed/popular Browse Reddit's popular feed
redditPostsIdCommentsGet GET /reddit/posts/{id}/comments List Reddit comments on a post
redditPostsIdGet GET /reddit/posts/{id} Get a Reddit post by id
redditSubredditsNameGet GET /reddit/subreddits/{name} Get a Reddit subreddit by name
redditTrendingSearchesGet GET /reddit/trending-searches List Reddit's current trending search queries
redditUsersUsernameCommentsGet GET /reddit/users/{username}/comments List Reddit comments authored by a user
redditUsersUsernameGet GET /reddit/users/{username} Get a Reddit user profile by username
redditUsersUsernamePostsGet GET /reddit/users/{username}/posts List Reddit posts authored by a user

redditFeedHomeGet

RedditFeedHomeGet200Response redditFeedHomeGet(cursor)

Browse Reddit's anonymous home feed

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.RedditApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    RedditApi apiInstance = new RedditApi(defaultClient);
    String cursor = "cursor_example"; // String | 
    try {
      RedditFeedHomeGet200Response result = apiInstance.redditFeedHomeGet(cursor);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling RedditApi#redditFeedHomeGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
cursor String [optional]

Return type

RedditFeedHomeGet200Response

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

redditFeedNewsGet

RedditFeedHomeGet200Response redditFeedNewsGet(cursor)

Browse Reddit's news feed

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.RedditApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    RedditApi apiInstance = new RedditApi(defaultClient);
    String cursor = "cursor_example"; // String | 
    try {
      RedditFeedHomeGet200Response result = apiInstance.redditFeedNewsGet(cursor);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling RedditApi#redditFeedNewsGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
cursor String [optional]

Return type

RedditFeedHomeGet200Response

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

redditFeedPopularGet

RedditFeedHomeGet200Response redditFeedPopularGet(cursor)

Browse Reddit's popular feed

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.RedditApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    RedditApi apiInstance = new RedditApi(defaultClient);
    String cursor = "cursor_example"; // String | 
    try {
      RedditFeedHomeGet200Response result = apiInstance.redditFeedPopularGet(cursor);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling RedditApi#redditFeedPopularGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
cursor String [optional]

Return type

RedditFeedHomeGet200Response

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

redditPostsIdCommentsGet

RedditPostsIdCommentsGet200Response redditPostsIdCommentsGet(id, cursor)

List Reddit comments on a post

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.RedditApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    RedditApi apiInstance = new RedditApi(defaultClient);
    String id = "id_example"; // String | 
    String cursor = "cursor_example"; // String | 
    try {
      RedditPostsIdCommentsGet200Response result = apiInstance.redditPostsIdCommentsGet(id, cursor);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling RedditApi#redditPostsIdCommentsGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
id String
cursor String [optional]

Return type

RedditPostsIdCommentsGet200Response

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

redditPostsIdGet

RedditPostsIdGet200Response redditPostsIdGet(id)

Get a Reddit post by id

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.RedditApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    RedditApi apiInstance = new RedditApi(defaultClient);
    String id = "id_example"; // String | Reddit post fullname, e.g. `t3_1thjm1o`.
    try {
      RedditPostsIdGet200Response result = apiInstance.redditPostsIdGet(id);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling RedditApi#redditPostsIdGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
id String Reddit post fullname, e.g. `t3_1thjm1o`.

Return type

RedditPostsIdGet200Response

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

redditSubredditsNameGet

RedditSubredditsNameGet200Response redditSubredditsNameGet(name)

Get a Reddit subreddit by name

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.RedditApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    RedditApi apiInstance = new RedditApi(defaultClient);
    String name = "name_example"; // String | Subreddit slug without `r/`, e.g. `pics`.
    try {
      RedditSubredditsNameGet200Response result = apiInstance.redditSubredditsNameGet(name);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling RedditApi#redditSubredditsNameGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
name String Subreddit slug without `r/`, e.g. `pics`.

Return type

RedditSubredditsNameGet200Response

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

redditTrendingSearchesGet

RedditTrendingSearchesGet200Response redditTrendingSearchesGet()

List Reddit's current trending search queries

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.RedditApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    RedditApi apiInstance = new RedditApi(defaultClient);
    try {
      RedditTrendingSearchesGet200Response result = apiInstance.redditTrendingSearchesGet();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling RedditApi#redditTrendingSearchesGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

This endpoint does not need any parameter.

Return type

RedditTrendingSearchesGet200Response

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

redditUsersUsernameCommentsGet

RedditPostsIdCommentsGet200Response redditUsersUsernameCommentsGet(username, cursor)

List Reddit comments authored by a user

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.RedditApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    RedditApi apiInstance = new RedditApi(defaultClient);
    String username = "username_example"; // String | 
    String cursor = "cursor_example"; // String | 
    try {
      RedditPostsIdCommentsGet200Response result = apiInstance.redditUsersUsernameCommentsGet(username, cursor);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling RedditApi#redditUsersUsernameCommentsGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
username String
cursor String [optional]

Return type

RedditPostsIdCommentsGet200Response

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

redditUsersUsernameGet

RedditUsersUsernameGet200Response redditUsersUsernameGet(username)

Get a Reddit user profile by username

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.RedditApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    RedditApi apiInstance = new RedditApi(defaultClient);
    String username = "username_example"; // String | 
    try {
      RedditUsersUsernameGet200Response result = apiInstance.redditUsersUsernameGet(username);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling RedditApi#redditUsersUsernameGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
username String

Return type

RedditUsersUsernameGet200Response

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -

redditUsersUsernamePostsGet

RedditFeedHomeGet200Response redditUsersUsernamePostsGet(username, cursor)

List Reddit posts authored by a user

Example

// Import classes:
import com.unifapi.sdk.ApiClient;
import com.unifapi.sdk.ApiException;
import com.unifapi.sdk.Configuration;
import com.unifapi.sdk.auth.*;
import com.unifapi.sdk.models.*;
import com.unifapi.sdk.api.RedditApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.unifapi.com");
    
    // Configure HTTP bearer authorization: bearerAuth
    HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
    bearerAuth.setBearerToken("BEARER TOKEN");

    RedditApi apiInstance = new RedditApi(defaultClient);
    String username = "username_example"; // String | 
    String cursor = "cursor_example"; // String | 
    try {
      RedditFeedHomeGet200Response result = apiInstance.redditUsersUsernamePostsGet(username, cursor);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling RedditApi#redditUsersUsernamePostsGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
username String
cursor String [optional]

Return type

RedditFeedHomeGet200Response

Authorization

bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
400 Validation or invalid-id error -
401 Missing, invalid, disabled, revoked, or expired UnifAPI API key -
402 Insufficient workspace credits -
404 Resource not found -
429 Rate limited -
500 Internal error -
502 Source error -
503 Source unavailable -