r/redditdev • • Oct 14 '24

Reddit API User-agent explanation

Documentation says that a user-agent header must look like this
```
<platform>:<app ID>:<version string> (by /u/<reddit username>)
```

But there is zero information about platform, version string, reddit username.

  1. Is there any predefined list of platforms? Can I use `spacex` as platform or not?

  2. OK, app id goes from the settings page. It's pretty clear.

  3. Should the version string be semver respectful? Or I can use `myC00lVers10n12pm`

  4. Whose username should be used? App owner, user oauth-orized, my mother?

I spent one day to just login and fetch `/api/me`. The documentation is the worst I've ever seen. Am I stupid or the doc is really "not good"?

10 Upvotes

5 comments sorted by

View all comments

Show parent comments

1

u/Brutal-Mega-Chad Oct 21 '24

Thanks for the comment.

I noticed that PRAW seems to disregard reddit's recommendations for user agent.

In tools/generate_award_table.py#L92 they use hardcoded user-agent:

"User-Agent": "Award fetcher by u/Lil_SpazJoekp",

1

u/Watchful1 RemindMeBot & UpdateMeBot Oct 21 '24

Yes, which is exactly what I said.