Skip to content

Temporary tokens

Justin Forest edited this page Feb 1, 2024 · 10 revisions

Guest tokens let applications access anonymous parts of the RedGIFs API (the ones that aren't related to a user, e.g. searching for gifs). This is what most mobile apps and personal scripts should be using.

Requesting a temporary token:

GET /v2/auth/temporary HTTP/1.1
Host: api.redgifs.com
Accept: application/json

{
 "token":"...",
 "addr":"2a00::579f:3c01:b94e",
 "agent":"curl/7.81.0",
 "rtfm":"https://github.com/Redgifs/api/wiki/API-access"
}

Limitations

Guest tokens have a low rate limit, short expiration time and should not be shared between applications (which might not work anyway). There is no way to refresh a guest token upon expiration -- just request a new one when the token age is reaching 24 hours.

There is a strict limit on how many guest tokens you can request per hour. Violating that limit will result in your API access blocked for a long time. Please save the received tokens and reuse them. You only need a new token when the one you have expires, or when your IP address changes.

Guest tokens cannot be used by web apps, since our CORS policy doesn't allow request from domains not owned by RedGIFs.

For apps that require anonymous read only access to the API, but with a large user base, client tokens should be used. That would also guarantee that we know about your app and won't break it suddenly if our guest token policy changes.