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}&lines[]=${line_1}&lines[]=${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
parameter can be a template ID or URL:
Here are some sample clients to explore:
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 |
Additional clients can be found by searching for code examples on GitHub.
Unauthenticated API requests are watermarked and may be rate limited. To request an API key please contact us to inquire about pricing for your specific use case.
Authenticated requests can be made using a header:
$ curl "https://api.memegen.link/images/fry/http_header/example.png" --header "X-API-KEY: myapikey" --output http_header_example.png
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=myapikey" --output query_parameter_example.png
Authenticated requests can also add their own watermark to images using the watermark
query parameter. For example, https://api.memegen.link/images/awesome/custom_watermark/example.png?api_key=myapikey&watermark=example.com
The beta integration is available here: https://zapier.com/apps/memegenlink