reddit/reddit — Issue #270: Inconsistency in the flairlist api with respect to other APIs
Author: bboe
Created: 2011-12-02 08:36:18+00:00
State: open

I don't know what the exact reddit terminology is, but here goes: The flairlist api, __/r/\/api/flairlist__ is similar to the submissions api __/r/\/.json__ and comments api, __/\/r/comments/\/.json__ in that it only returns a finite number of results on each call. Similar to both submissions and comments, flairlist subsequent results can be fetched by passing an appropriate valued __after__ parameter.

I just added support in the [reddit_api](https://github.com/mellort/reddit_api/) module for grabbing flairlists. If you look at the last three arguments to the [_get_content](https://github.com/mellort/reddit_api/blob/master/reddit/__init__.py#L124) function, _root_field_, _thing_field_, _after_field_, you may notice that I had to special case these items for the _flairlist_ api.

The reason for this is because both the comment and submission api return data like so:

```python
{'data' : {'children' : [...], 'after' : 'someid'}}
```

whereas the flairlist api returns data like so:

```python
{'users' : [...], 'next' : 'someid'}
```

There are three discrepancies here:

0. There is no exterior _data_ encapsulation in the flairlist result.
0. The key pertaining to the list differs: _children_ v. _users_
0. The key pertaining to the __after__ element differs: _after_ v. _next_ (particularly interesting because the url parameter _after_ works in both cases)

Aside from these three inconsistencies, there is also the inconsistency of not returning the defined types as is done with comments and submissions. What I mean is that the _user_ objects returned by the flairlist api are simply usernames whereas in both the _comment_ and _submission_ APIs they represent an object with an __id__ and a __username__.

Finally, I would like to add that I'm not complaining. I think having these APIs are great, though I think they could be improved by making them consistent.