# How do I search memes by keyword with an API for my Slack bot?

> Use memecub's REST API to search memes by keyword: send a GET request with your query, get back matching memes, and post the image URL to Slack. The API costs 1 credit per search, and you can try it keyless with 20 searches a day. For a Slack bot, wrap the search in a slash command like /meme <keyword> and reply with the top result.

- **Canonical URL**: https://memecub.com/guides/search-memes-by-keyword-api-slack-bot
- **Category**: For developers and AI agents (https://memecub.com/guides/c/developer)
- **Language**: en
- **Updated**: 2026-12-06

## Recommended Memes (Copy-Ready Markdown)

### Found The Bug

- **When to send**: Send when a bug is found in production and you want to celebrate the discovery.
- **Page**: https://memecub.com/meme/bng431gpaafr-found-the-bug
- **License**: Web-collected · Personal use

![Found The Bug](https://gpic.code-nav.cn/memecub/public/bng431gpaafr.jpg)

### Search And Replace

- **When to send**: Use when someone suggests a search-and-replace fix for a complex problem.
- **Page**: https://memecub.com/meme/ddfh5idh8by9-search-and-replace
- **License**: Web-collected · Personal use

![Search And Replace](https://gpic.code-nav.cn/memecub/public/ddfh5idh8by9.jpg)

### When Your HR's Keyword Filter Is Too Angular

- **When to send**: Post when HR's keyword filter rejects a perfectly good candidate.
- **Page**: https://memecub.com/meme/k8zglb7r2guh-when-your-hr-s-keyword-filter-is-too-angular
- **License**: Web-collected · Personal use

![When Your HR's Keyword Filter Is Too Angular](https://gpic.code-nav.cn/memecub/public/k8zglb7r2guh.jpg)

### My Workplace's Diabolical Regex For Matching E-Mail Formats

- **When to send**: Share when a regex for email validation fails spectacularly.
- **Page**: https://memecub.com/meme/1cu7phtbvgaa-my-workplace-s-diabolical-regex-for-matching-e-mail-formats
- **License**: Web-collected · Personal use

![My Workplace's Diabolical Regex For Matching E-Mail Formats](https://gpic.code-nav.cn/memecub/public/1cu7phtbvgaa.png)

### I Love Regex

- **When to send**: Send when a teammate confesses their love for regex.
- **Page**: https://memecub.com/meme/6b1iunimqnp0-i-love-regex
- **License**: Web-collected · Personal use

![I Love Regex](https://gpic.code-nav.cn/memecub/public/6b1iunimqnp0.jpg)

### Yesterday I Discovered The Mutable Keyword

- **When to send**: Use when someone discovers the mutable keyword and everything changes.
- **Page**: https://memecub.com/meme/beyt2vffhv7v-yesterday-i-discovered-the-mutable-keyword
- **License**: Web-collected · Personal use

![Yesterday I Discovered The Mutable Keyword](https://gpic.code-nav.cn/memecub/public/beyt2vffhv7v.jpg)

### Finally Found It

- **When to send**: Post when you finally find the 404 page you were looking for.
- **Page**: https://memecub.com/meme/lqizzsl7octt-finally-found-it
- **License**: Web-collected · Personal use

![Finally Found It](https://gpic.code-nav.cn/memecub/public/lqizzsl7octt.jpg)

### What If Someone Got One From HP

- **When to send**: Send when a new hire gets a laptop from an unexpected brand.
- **Page**: https://memecub.com/meme/jx5gsl7abvug-what-if-someone-got-one-from-hp
- **License**: Web-collected · Personal use

![What If Someone Got One From HP](https://gpic.code-nav.cn/memecub/public/jx5gsl7abvug.jpg)

## How the memecub API works

The memecub REST API lets you search the meme library by keyword. Each search call costs 1 credit. You can try it without a key: the keyless trial allows 20 searches a day.

A search returns meme results with fields like id, title, description, and image URL. Use the image URL to post the meme in Slack.

For AI agents, there is also a remote MCP server at https://memecub.com/mcp and a CLI you can run with npx memecub. A skill can be installed with npx skills add https://memecub.com into Claude Code, Codex, Cursor, and others.

## Example: a Slack slash command that searches memes

Set up a Slack slash command (e.g., /meme) that points to your bot's endpoint. When a user types /meme <keyword>, your bot calls the memecub search API with that keyword.

Here is a minimal Node.js example using fetch (replace YOUR_API_KEY with your key, or omit for keyless trial):

const res = await fetch('https://memecub.com/api/search?q=' + encodeURIComponent(keyword), { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }); const data = await res.json(); const meme = data.results[0];

Then post the meme to Slack using chat.postMessage with the image URL in blocks or attachments. Handle errors like no results or rate limits gracefully.

## When to use which meme

Pick memes that match the channel's tone. For developer channels, regex and bug memes work well. For general chat, use workplace or reaction memes.

If the search returns nothing fitting, you can use the AI meme maker at /generate to create a custom meme from a description. It takes about 10 seconds per image and costs 500 credits.

Remember that most memes are collected from the web and are for personal chats only; copyright stays with the original creators. For commercial use, enable the filter for openly licensed images.

## FAQ

### How do I find a fitting meme by keyword through an API?

Call the memecub search endpoint with your keyword as a query parameter. The API returns matching memes with image URLs you can use directly.

### How do I query a meme library by text from a bot?

From your bot, send an HTTP GET request to the memecub API with the text as the q parameter. Parse the JSON response and pick the first result or let the user choose.

### How do I get a meme for a given phrase with an API?

Use the same search API with the phrase as the keyword. If no results match, consider using the AI meme maker to generate a custom meme from the phrase.

### Is there a free trial for the memecub API?

Yes, the keyless trial allows 20 searches a day. Paid plans start with a free tier of 1000 credits a month, and credit packs are available from $5.

## Related Guides

- [How do I let an AI agent search and send memes with a remote MCP server?](https://memecub.com/guides/ai-agent-search-send-memes-remote-mcp.md) ([HTML](https://memecub.com/guides/ai-agent-search-send-memes-remote-mcp))
- [How do I let an AI agent find and send memes with an MCP server?](https://memecub.com/guides/ai-agent-find-send-memes-mcp.md) ([HTML](https://memecub.com/guides/ai-agent-find-send-memes-mcp))
- [How do I let Claude search and place memes automatically?](https://memecub.com/guides/let-claude-search-and-place-memes.md) ([HTML](https://memecub.com/guides/let-claude-search-and-place-memes))
- [What meme API or MCP server can I use to search and place memes in my app?](https://memecub.com/guides/meme-api-mcp-server.md) ([HTML](https://memecub.com/guides/meme-api-mcp-server))
- [How do I search memes by keyword with an API to place in blog posts?](https://memecub.com/guides/search-memes-by-keyword-api-blog-posts.md) ([HTML](https://memecub.com/guides/search-memes-by-keyword-api-blog-posts))
- [How can I search memes by keyword using an API?](https://memecub.com/guides/search-memes-by-keyword-api.md) ([HTML](https://memecub.com/guides/search-memes-by-keyword-api))

---
Provided by [memecub](https://memecub.com) · Full index: [https://memecub.com/llms.txt](https://memecub.com/llms.txt) · Remote MCP: `https://memecub.com/mcp`