# reddit-api-generator

> Converts Reddit's API into structured formats

Latest version **3.0.0** (published 2014-11-27) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install reddit-api-generator
pnpm add reddit-api-generator
yarn add reddit-api-generator
bun add reddit-api-generator
```

Provides the command `reddit-api-generator`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2014-11-27 |
| First published | 2014-01-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Trevor Senior |
| Maintainers | trevorsenior |
| Keywords | reddit, api, generate |

## Links

- npm: https://www.npmjs.com/package/reddit-api-generator
- Repository: https://github.com/trevorsenior/reddit-api-generator
- Issues: https://github.com/trevorsenior/reddit-api-generator/issues
- npm.io page: https://npm.io/package/reddit-api-generator

## Recent versions

- 3.0.0 (latest) — 2014-11-27
- 2.1.0 — 2014-11-12
- 2.0.0 — 2014-09-22
- 1.2.1 — 2014-08-10
- 1.2.0 — 2014-08-10
- 1.1.0 — 2014-07-08
- 1.0.0 — 2014-05-27
- 0.0.9 — 2014-05-19
- 0.0.8 — 2014-03-18
- 0.0.7 — 2014-03-08
- 0.0.6 — 2014-02-16
- 0.0.5 — 2014-02-05
- 0.0.4 — 2014-01-26
- 0.0.3 — 2014-01-26
- 0.0.2 — 2014-01-23
- … 1 more at https://npm.io/package/reddit-api-generator/versions

## README

# reddit-api-generator

Transforms the auto generated [Reddit API](http://www.reddit.com/dev/api) into structured formats for consumption by anyone looking to write a wrapper for the Reddit API.

The `dist` folder contains the various outputs that can be consumed.

### Data Format

The data format is a flat array of endpoints.

Every endpoint has enough data with it to create a call to the Reddit API. Here is a sample of one endpoint [`[/r/subreddit]/new`](http://www.reddit.com/dev/api#GET_new):

```javascript
[
    {
        "path": "/r/$subreddit/new",
        "url": {
            "oauth": "https://oauth.reddit.com/r/$subreddit/new",
            "standard": "http://www.reddit.com/r/$subreddit/new"
        },
        "oauth": [
            "read"
        ],
        "extensions": [
            ".json",
            ".xml"
        ],
        "method": "GET",
        "describe": "This endpoint is a listing.",
        "args": {
            "after": {
                "describe": "fullname of a thing"
            },
            "before": {
                "describe": "fullname of a thing"
            },
            "count": {
                "describe": "a positive integer (default: 0)"
            },
            "limit": {
                "describe": "the maximum number of items desired (default: 25, maximum: 100)"
            },
            "show": {
                "describe": "(optional) the string all"
            }
        }
    },
    {/* another endpoint */},
    {/* and another... */}
]
```

### Url parameters

Sometimes there are parameters in the url. These are represented with a "`$`" prepending the name of the variable. Given [this path](http://www.reddit.com/dev/api#DELETE_api_multi_{multipath}_r_{srname}), the path in the endpoint will look like:

    /api/multi/$multipath/r/$srname

## Install

**Without a package manager**

Pull out the files you need from the dist folder.

**npm**

```
npm install reddit-api-generator
```

**bower**

```
bower install reddit-api-generator
```

## Usage

**JSON**

Raw JSON can be used in any language.

**Node.js**

```javascript
var redditApi = require('reddit-api-generator');
```

**AMD**

```javascript
requirejs(['reddit-api-generator'], function(redditApi) {

});
```

## Test

```
npm test
```

## Building

Run the command `bin/buildAll.sh`

---
_Source: https://npm.io/package/reddit-api-generator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
