Skip to content

Commit

Permalink
Added fields and crosspost_parent_id to api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurHeitmann committed Jan 27, 2024
1 parent 41206ed commit cb45a97
Showing 1 changed file with 31 additions and 20 deletions.
51 changes: 31 additions & 20 deletions api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ Search UI: https://arctic-shift.photon-reddit.com/search

Retrieve things based on their ID

| Parameter | Type | Default | Notes |
|-----------|-----------|---------|------------------------------------------------------------------|
| `ids` | `ID[]` | | Comma separated list |
| `md2html` | `boolean` | `false` | If `true`, adds auto generated `selftext_html`/`body_html` field |
| Parameter | Type | Default | Notes |
|-----------|-----------|---------|----------------------------------------------------------------------------|
| `ids` | `ID[]` | | Comma separated list |
| `md2html` | `boolean` | `false` | If `true`, adds auto generated `selftext_html`/`body_html` field |
| `fields` | `string` | | Comma separated list of fields to return ([more info](#selectable-fields)) |

## Search

Expand All @@ -40,25 +41,27 @@ Search for posts or comments

Common parameters:

| Parameter | Type | Default | Notes |
|-------------|-----------------|---------|------------------------------------------------------------------|
| `author` | `string` | | |
| `subreddit` | `string` | | |
| `after` | `Date` | | |
| `before` | `Date` | | |
| `limit` | `int` (1 - 100) | 25 | |
| `sort` | `asc` \| `desc` | | Results are sorted by `created_utc` |
| `md2html` | `boolean` | `false` | If `true`, adds auto generated `selftext_html`/`body_html` field |
| Parameter | Type | Default | Notes |
|-------------|-----------------|---------|----------------------------------------------------------------------------|
| `author` | `string` | | |
| `subreddit` | `string` | | |
| `after` | `Date` | | |
| `before` | `Date` | | |
| `limit` | `int` (1 - 100) | 25 | |
| `sort` | `asc` \| `desc` | | Results are sorted by `created_utc` |
| `md2html` | `boolean` | `false` | If `true`, adds auto generated `selftext_html`/`body_html` field |
| `fields` | `string` | | Comma separated list of fields to return ([more info](#selectable-fields)) |

Post search parameters:

| Parameter | Type | Default | Notes |
|------------|-----------|---------|----------------------------------------------------------------------------------------------------------------------------|
| `over_18` | `boolean` | | |
| `spoiler` | `boolean` | | |
| `selftext` | `string` | | (full text search) Only in use with `author` or `subreddit` parameter (not supported with very active users or subreddits) |
| `title` | `string` | | (full text search) Only in use with `author` or `subreddit` parameter (not supported with very active users or subreddits) |
| `url` | `string` | | (exact match) |
| Parameter | Type | Default | Notes |
|-----------------------|-----------|---------|----------------------------------------------------------------------------------------------------------------------------|
| `crosspost_parent_id` | `ID` | | |
| `over_18` | `boolean` | | |
| `spoiler` | `boolean` | | |
| `selftext` | `string` | | (full text search) Only in use with `author` or `subreddit` parameter (not supported with very active users or subreddits) |
| `title` | `string` | | (full text search) Only in use with `author` or `subreddit` parameter (not supported with very active users or subreddits) |
| `url` | `string` | | (exact match) |

Comment search parameters:

Expand Down Expand Up @@ -166,6 +169,14 @@ limiting options.

## Data type notes

#### **Selectable fields**

By only selecting the fields you need, you can potentially reduce the response time and size.

Common: `author`, `author_flair_text`, `created_utc`, `distinguished`, `id`, `retrieved_on`, `subreddit`, `score`
Posts: `crosspost_parent_id`, `link_flair_text`, `over_18`, `selftext`, `spoiler`, `title`, `url`
Comments: `body`, `link_id`, `parent_id`

**Boolean**

True values: `true`, `1`, `yes`, `y`
Expand Down

0 comments on commit cb45a97

Please sign in to comment.