Sample Code
Here are some popular apps and integrations to check out:
Platforms | Language | Website |
---|---|---|
Slack | Python | https://github.com/nicolewhite/slack-meme |
Slack | Go | https://github.com/CptSpaceToaster/slackbot |
Slack | -- | http://www.memetizer.com |
Hain | JavaScript | https://github.com/Metrakit/hain-plugin-meme |
Web | Clojure | https://github.com/jasich/mighty-fine-memes |
Web & Slack | -- | https://memecomplete.com |
Discord | JavaScript | https://github.com/parshsee/discordbot |
Legobot | Python | https://github.com/drewpearce/legos.memes |
Additional clients can be found by searching for code examples on GitHub. Or create your own!
Authentication
Unauthenticated API requests are watermarked and may be rate-limited or used as training data. Individuals sponsoring this project at $10/month or higher are welcome to an API key. Please contact support to request one or inquire about pricing for your specific use case.
HTTP Header
Authenticated requests can be made using a header:
$ curl "https://api.memegen.link/images/fry/http_header/example.png" \
--header "X-API-KEY: myapikey42" --output http_header_example.png --location
Query Parameter
If that's not an option, the API key can also be added as a query parameter:
$ curl "https://api.memegen.link/images/fry/query_parameter/example.png?api_key=myapikey42" \
--output query_parameter_example.png --location
Image Previews
If your client is going to show typeahead image previews, please use the /images/preview.jpg
endpoint, which accepts URL-encoded parameters and returns smaller images to minimize bandwidth:
var typingTimer
$("#form").keyup(function () {
clearTimeout(typingTimer)
typingTimer = setTimeout(updatePreview, 500)
})
function updatePreview() {
var template = encodeURIComponent($("#template").val())
var line_1 = encodeURIComponent($("#line_1").val() || " ")
var line_2 = encodeURIComponent($("#line_2").val() || " ")
var api = "https://api.memegen.link/images/preview.jpg"
var url = `${api}?template=${template}&text[]=${line_1}&text[]=${line_2}`
$("#preview").attr("src", url)
}
$(document).ready(updatePreview)
For example, https://api.memegen.link/images/preview.jpg?template=iw&lines[]=live+preview&lines[]=while+typing produces:
The template=<str>
query parameter can be a template ID or URL:
Custom Watermark
Authenticated requests can also add their own watermark to images using the watermark=<str>
query parameter.
For example, https://api.memegen.link/images/puffin/custom_watermark/example.png?api_key=myapikey42&watermark=example.com produces:
Zapier Integration
Incorporate memes into your workflow automation: https://zapier.com/apps/memegenlink