Skip to content

Get gif endpoint

Alvin Cheng edited this page Apr 23, 2023 · 2 revisions

Description

This is the get gif endpoint, this endpoint will send all the gifs that showup from the search query if the search query is 'null' then the trending gif will be fetched. This endpoint will use the GIPHY API to fetch all the gifs and forward them to the client in a giphy default schema. more info here. The server will send a status of '401' on an invalid API key, '500' on an internal server error and '200' on success. Here is an example below:

Example:

fetch("http://<URL>/api/get-gif?key=<YOUR_API_KEY>&search=<ROOM>")
  .then((res) => {
    console.log(res);
  })
  .catch((err) => {
    console.error(err);
  });
Clone this wiki locally