A scraper npm package to search and get information about memes from KnowYourMeme.com.
GitHub: knowyourmeme-js
- 🔍 Search memes by query with customizable result limits
- 📖 Get detailed meme information including images, tags, origin, and more
- 🚀 Fast and lightweight using Cheerio for HTML parsing
- 📦 ES6 modules support
- 🔵 TypeScript support
- 🛡️ Error handling with descriptive error messages
npm install knowyourmeme-jsimport { search } from 'knowyourmeme-js';
// Search for memes
const results = await search('shrek');
console.log(results);import { search } from 'knowyourmeme-js';
// Search with custom limit
const results = await search('shrek', 5); // default is 10
console.log(`Found ${results.length} results`);
console.log(results);import { getMeme } from 'knowyourmeme-js';
// Get detailed information about a specific meme
const meme = await getMeme('https://knowyourmeme.com/memes/shrek-rizz');
console.log(meme);Searches for memes on KnowYourMeme.com.
Parameters:
query(string): Search querymax(number): Maximum number of results (default: 10)
Returns: Promise - Promise resolving to an array of MemeResult
Search Result Object:
{
title: string,
link: string,
thumbnail: { url: string, alt: string }
}Gets detailed information about a specific meme.
Parameters:
url(string): URL of the meme page on KnowYourMeme.com
Returns: Promise - Promise of MemeDetails
MemeDetails Object:
{
title: string,
link: string,
image: { url: string, alt: string },
views: number | null,
sections: MemeSection[],
googleTrends: string,
type: string[],
year: string,
origin: string,
region: string,
tags: string[]
}- Node.js 14.0.0 or higher
- ES6 modules support
axios: HTTP client for making requestscheerio: HTML parsing and manipulation
Contributions are welcome! Please feel free to submit a Pull Request.
This project is not affiliated with or endorsed by KnowYourMeme.com.
It simply scrapes publicly available data for educational and personal use.
Please use this library responsibly and respect the website’s Terms of Service.