Home › Meme API

Meme API

Find the right meme for any moment: search 450,000+ memes by keyword or by the words printed inside the image, filter by images or videos, rating and age, or pull a random meme.

Get a free API key Read the docs See pricing

What the meme API does

Search memes

EndpointGET https://api.humorapi.com/memes/search
AuthenticationAPI key as api-key query parameter or x-api-key header
ResponseJSON
Cost1 point per call
ReferenceSearch Memes in the docs
Example request
GET https://api.humorapi.com/memes/search?number=3&keywords=rocket
Example response
{
    "memes": [
        {
            "id": 6696,
            "url": "https://i.imgur.com/1rmAxUG.jpg",
            "type": "image/jpeg"
        },
        {
            "id": 6697,
            "url": "https://i.imgur.com/ELT8zMQ.jpg",
            "type": "image/jpeg"
        },
        {
            "id": 6698,
            "url": "https://i.imgur.com/8JTc5z3.jpg",
            "type": "image/jpeg"
        }
    ],
    "available": 32
}
curl
curl "https://api.humorapi.com/memes/search?number=3&keywords=rocket&api-key=YOUR_API_KEY"
JavaScript (fetch)
const res = await fetch("https://api.humorapi.com/memes/search?number=3&keywords=rocket", {
  headers: { "x-api-key": process.env.HUMOR_API_KEY }
});
const data = await res.json();
console.log(data);
Python (requests)
import os, requests

res = requests.get("https://api.humorapi.com/memes/search?number=3&keywords=rocket",
                   headers={"x-api-key": os.environ["HUMOR_API_KEY"]})
print(res.json())

Get a random meme

GET https://api.humorapi.com/memes/random?keywords=rocket
Example response
{
    "id": 50561,
    "url": "https://preview.redd.it/hg0zn2mhjsh01.png?width=640&crop=smart&auto=webp&s=f19b0a87edfc6c71b35ec9aceb64799cd532ff59",
    "type": "image/png"
}

All meme endpoints

Search MemesGET /memes/search
With over 450,000 memes, you'll surely find something funny. You can even search for text within memes and filter by user ratings.
Random MemeGET /memes/random
Get a random meme out of over 450,000 memes and growing.
Upvote MemePOST /memes/{id}/upvote
Upvote a meme that you or your users like.
Downvote MemePOST /memes/{id}/downvote
Downvote a meme that you or your users like.

Example: a meme slash command

Answer /meme rocket in a chat app with the first matching meme:

async function findMeme(query) {
  const url = "https://api.humorapi.com/memes/search?number=1&media-type=image&keywords="
    + encodeURIComponent(query);
  const res = await fetch(url, { headers: { "x-api-key": process.env.HUMOR_API_KEY } });
  const { memes } = await res.json();
  return memes.length ? memes[0].url : "No meme found.";
}

There is no adult-content filter for memes. Use min-rating to favor well-liked memes, and review results before you show them to young audiences.

Pricing

The free plan has 10 points per day (most calls cost 1 point) and needs a backlink; paid plans start at $3 per month for 100 points per day and bill extra points instead of stopping. Compare the plans.

Questions about the meme API

Can I search the text inside memes?

Yes. Add keywords-in-image=true to Search Memes or Random Meme, and only memes whose image contains your keywords are returned.

Does the meme API generate memes from templates?

No. Humor API searches and serves existing memes; it does not caption templates. Our meme API comparison lists APIs that do.

How many memes can I get per call?

Up to 10 per Search Memes call; page through more with offset.

More from Humor API

Joke API GIF Search API Insult & Praise API Nonsense Word API Chuck Norris Jokes API Knock Knock Jokes API

Get a free API key Read the docs See pricing