Meme Generator API

Table of Contents

Basics

Methods

API Key

Accessing the API requires an API key. The API key identifies your application (mobile app, website, etc), as opposed to authentication which identifies the specific user that is accessing the API.

To sign up for an API key go to this page.

All method requests require the parameter apiKey=[apiKey].

Limits

API usage is not limited in any way, but if you are using it in either a free or a commercial application, please make it clear to the users that your application is powered by memegenerator.net.

Authentication

Authentication to the API can be done with credentials of any user from the website. Most methods can be used with or without authentication. To invoke a method in the context of a particular user, provide the method with a [sessionKey] that you get from logging in the user with MgUser_Login(). Even methods that only select data benefit from using a logged in session key because then they can return the data with voting information for the logged in user. Make sure to check the result for errors in case the sessionKey has expired and the user needs to be logged in again.

Images

imageUrl

When parsing a returned JSON, the field imageUrl always refers to an image of a character without any captioned text, for example:

The image can be resized by changing the URL: Any number can be used as the width or height, though the image will not be resized to a size larger than it originally is.

instanceImageUrl

When parsing a returned JSON, the field instanceImageUrl always refers to an image of a character with its captioned text, for example:

The instance image can be resized by changing the URL: Any number can be used as the width or height, though the image will not be resized to a size larger than it originally is.

JavaScript Library

JavaScript bindings to the API calls can be used from http://version1.api.memegenerator.net/javascript.js.

Example usage:

window.MgApi.SetApiKey('[your api key]'); // This is called only once. Get your api key at https://memegenerator.net/api.
window.MgApi.Login('username', 'password'); // This is optional, if the user of your app logs in.
// Most functions can be called anonymously, without logging in.

window.MgApi.Generators_Search('frog', 0, 24);

Comment_Create

http://version1.api.memegenerator.net//Comment_Create

Description

Post a comment to an instance. Use entityName=Instance for instance, with entityID=[instanceID].

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.
entityName Use 'Instance' for instances or 'Generator' for generators.
entityID For entityName=Instance, the entityID would be the instanceID.
parentCommentID
optional
The comment whose child comments we're interested in.
text Some text.

Example

http://version1.api.memegenerator.net//Comment_Create?entityName=Instance&entityID=72628355&parentCommentID=&text=first post best post&apiKey=demo

Comment_Delete

http://version1.api.memegenerator.net//Comment_Delete

Description

Delete a comment, will only work if the user has created it or is admin.

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.
commentID The ID of the comment

Example

http://version1.api.memegenerator.net//Comment_Delete?commentID=-1&apiKey=demo

Comments_Select

http://version1.api.memegenerator.net//Comments_Select

Description

Returns all the comments for a specific entity. Use entityName=Instance for instance, with entityID=[instanceID].

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.
entityName Use 'Instance' for instances or 'Generator' for generators.
entityID For entityName=Instance, the entityID would be the instanceID.
parentCommentID
optional
The comment whose child comments we're interested in.

Example

http://version1.api.memegenerator.net//Comments_Select?entityName=Instance&entityID=72628355&parentCommentID=&apiKey=demo

ContentFlag_Create

http://version1.api.memegenerator.net//ContentFlag_Create

Description

Flag content for removal, for cases of harassment etc.

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.
contentUrl The URL on the website which contains the offending content.
reason A short description of why the content should be removed.
email Email address for notification of removal.

Example

http://version1.api.memegenerator.net//ContentFlag_Create?contentUrl=https://memegenerator.net/John-Doe&reason=personal information exposed&email=email@domain.com&apiKey=demo

Generator_Create

http://version1.api.memegenerator.net//Generator_Create

Description

Create a new generator.

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.
image Image url or HTTP posted file.
displayName The display name of the requested generator, e.g. 'Insanity Wolf'.

Example

http://version1.api.memegenerator.net//Generator_Create?image=https://cdn.meme.am/images/983.jpg&displayName=Insanity Wolf&apiKey=demo

Generator_Select_ByUrlNameOrGeneratorID

http://version1.api.memegenerator.net//Generator_Select_ByUrlNameOrGeneratorID

Description

Returns information about a specific generator, either by its [generatorID] or by its [urlName].

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.
generatorID
optional
The GeneratorID of the generator as received from any of the Generators_Select_* methods.
urlName The URL name of the requested generator, e.g. 'Insanity-Wolf'. Leave as [null] to show all the generators.

Example

http://version1.api.memegenerator.net//Generator_Select_ByUrlNameOrGeneratorID?generatorID=45&urlName=Insanity-Wolf&apiKey=demo

Generators_Search

http://version1.api.memegenerator.net//Generators_Search

Description

Returns a list of search results by the search keyword [q].

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.
q The search query.
pageIndex Page index of the requested result set. Defaults to 0 if not specified.
pageSize Page size of the requested result set. Defaults to 12 if not specified.

Example

http://version1.api.memegenerator.net//Generators_Search?q=insanity&pageIndex=0&pageSize=12&apiKey=demo

Generators_Select_ByMgUser

http://version1.api.memegenerator.net//Generators_Select_ByMgUser

Description

Returns generators created by a particular user.

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.
byMgUserID The ID of the user that created the content.
pageIndex Page index of the requested result set. Defaults to 0 if not specified.
pageSize Page size of the requested result set. Defaults to 12 if not specified.

Example

http://version1.api.memegenerator.net//Generators_Select_ByMgUser?byMgUserID=1&pageIndex=0&pageSize=12&apiKey=demo

Generators_Select_ByNew

http://version1.api.memegenerator.net//Generators_Select_ByNew

Description

Returns the most recently created generators. This list gets updated whenever the website moderators approve another batch of generators to appear on the website. Some generators may not be approved due to poor quality, nsfw content, etc, so this list is highly selective.

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.
pageIndex Page index of the requested result set. Defaults to 0 if not specified.
pageSize Page size of the requested result set. Defaults to 12 if not specified.

Example

http://version1.api.memegenerator.net//Generators_Select_ByNew?pageIndex=0&pageSize=12&apiKey=demo

Generators_Select_ByPopular

http://version1.api.memegenerator.net//Generators_Select_ByPopular

Description

Returns the most popular generators for the last [days] days.

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.
pageIndex Page index of the requested result set. Defaults to 0 if not specified.
pageSize Page size of the requested result set. Defaults to 12 if not specified.
days
optional
The time period for which to filter the result set. ([days] == null) for all time.

Example

http://version1.api.memegenerator.net//Generators_Select_ByPopular?pageIndex=0&pageSize=12&days=&apiKey=demo

Generators_Select_ByRecentlyCaptioned

http://version1.api.memegenerator.net//Generators_Select_ByRecentlyCaptioned

Description

Returns generators that were recently used to create an instence. Sort of most-recently-used list.

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.

Example

http://version1.api.memegenerator.net//Generators_Select_ByRecentlyCaptioned

Generators_Select_BySubscriber

http://version1.api.memegenerator.net//Generators_Select_BySubscriber

Description

Returns the list of generators that a particular user is subscribed to.

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.
subscriberMgUserID The mgUserID of the user whose subscriptions we're interested in.

Example

http://version1.api.memegenerator.net//Generators_Select_BySubscriber?subscriberMgUserID=1&apiKey=demo

Generators_Select_ByTrending

http://version1.api.memegenerator.net//Generators_Select_ByTrending

Description

Returns recently trending generators.

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.

Example

http://version1.api.memegenerator.net//Generators_Select_ByTrending

Generators_Select_ByUpvoted

http://version1.api.memegenerator.net//Generators_Select_ByUpvoted

Description

Returns generators upvoted (liked) by a particular user.

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.
byMgUserID The ID of the user that created the content.
pageIndex Page index of the requested result set. Defaults to 0 if not specified.
pageSize Page size of the requested result set. Defaults to 12 if not specified.

Example

http://version1.api.memegenerator.net//Generators_Select_ByUpvoted?byMgUserID=1&pageIndex=0&pageSize=12&apiKey=demo

Generators_Select_Related_ByDisplayName

http://version1.api.memegenerator.net//Generators_Select_Related_ByDisplayName

Description

Returns generators that are related to a particular generator, a sort of 'see also' list.

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.
displayName The display name of the requested generator, e.g. 'Insanity Wolf'.

Example

http://version1.api.memegenerator.net//Generators_Select_Related_ByDisplayName?displayName=Insanity Wolf&apiKey=demo

Instance_Create

http://version1.api.memegenerator.net//Instance_Create

Description

Creates a captioned image. Images created with this method are created in the database and may appear on the website. User credentials of an ordinary user must be provided to create images. Sign up on http://{memegenerator.net}/ to create your user. ImageID may by omitted to use the default template for the character, or specified to use one of the alternative templates.

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.
languageCode The language to filter the result set by, or the language of the text on the created image, indicated by a 2-letter language code. Currently supported languages are English (en), Spanish (es), French (fr), Hebrew (he), Russian (ru), Other (--).
generatorID The GeneratorID of the generator as received from any of the Generators_Select_* methods.
imageID
optional
The background image on which to caption the text. If generatorID is also requested then imageID must be one of the images of the specified generator, e.g. for Insanity Wolf (generatorID 45) the imageID must be 20, as received from any of the Generators_Select_* methods.
text0 The first line to appear on the image. If only one line is specified it will appear on the bottom of the image. If two lines are specified ([text0] and [text1]), [text0] will appear on the top and [text1] will appear on the bottom on the image. Both lines are automatically converted to uppercase.
text1 The second line to appear on the image. Will appear on the bottom of the image. Automatically converted to uppercase.

Example

http://version1.api.memegenerator.net//Instance_Create?languageCode=en&generatorID=45&imageID=20&text0=push a hipster down the stairs&text1=now look who's tumbling&apiKey=demo

Instance_Select

http://version1.api.memegenerator.net//Instance_Select

Description

Select an instance by its instanceID.

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.
instanceID The ID of the instance.

Example

http://version1.api.memegenerator.net//Instance_Select?instanceID=72628355&apiKey=demo

Instances_Search

http://version1.api.memegenerator.net//Instances_Search

Description

Returns a list of search results of instances by the search keyword [q].

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.
q The search query.
pageIndex Page index of the requested result set. Defaults to 0 if not specified.
pageSize Page size of the requested result set. Defaults to 12 if not specified.

Example

http://version1.api.memegenerator.net//Instances_Search?q=insanity&pageIndex=0&pageSize=12&apiKey=demo

Instances_Select_By_SubscriberMgUserID

http://version1.api.memegenerator.net//Instances_Select_By_SubscriberMgUserID

Description

Get the feed instances of the current user. Feed instances are all the instances from the user's subscribed to generators and users.

Parameters

sessionKey A logged in user session key. Use MgUser_Login to get a session key.
languageCode The language to filter the result set by, or the language of the text on the created image, indicated by a 2-letter language code. Currently supported languages are English (en), Spanish (es), French (fr), Hebrew (he), Russian (ru), Other (--).
fromInstanceID
optional
Feed instances are not paged, rather they are being infinitely scrolled. To get the next batch of instances, fromInstanceID specifies where (exclusively) we should start from.
pageSize Page size of the requested result set. Defaults to 12 if not specified.

Example

http://version1.api.memegenerator.net//Instances_Select_By_SubscriberMgUserID?sessionKey=[sessionKey]&languageCode=en&fromInstanceID=1000000&pageSize=12&apiKey=demo

Instances_Select_ByMgUser

http://version1.api.memegenerator.net//Instances_Select_ByMgUser

Description

Returns instances created by a particular user.

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.
byMgUserID The ID of the user that created the content.
pageIndex Page index of the requested result set. Defaults to 0 if not specified.
pageSize Page size of the requested result set. Defaults to 12 if not specified.

Example

http://version1.api.memegenerator.net//Instances_Select_ByMgUser?byMgUserID=1&pageIndex=0&pageSize=12&apiKey=demo

Instances_Select_ByNew

http://version1.api.memegenerator.net//Instances_Select_ByNew

Description

Returns recently created instances, for a particular generator ([urlName] != null) or for all generators ([urlName] == null). Only shows moderator approved content.

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.
languageCode The language to filter the result set by, or the language of the text on the created image, indicated by a 2-letter language code. Currently supported languages are English (en), Spanish (es), French (fr), Hebrew (he), Russian (ru), Other (--).
pageIndex Page index of the requested result set. Defaults to 0 if not specified.
urlName The URL name of the requested generator, e.g. 'Insanity-Wolf'. Leave as [null] to show all the generators.

Example

http://version1.api.memegenerator.net//Instances_Select_ByNew?languageCode=en&pageIndex=0&urlName=Insanity-Wolf&apiKey=demo

Instances_Select_ByPopular

http://version1.api.memegenerator.net//Instances_Select_ByPopular

Description

Returns the most popular instances for a particular period ([days]=null for all time, [days]=1 for the last day, [days]=7 for the last week, [days]=30 for the last month) for a particular generator ([urlName] != null) or for all generators ([urlName] == null). Only shows moderator approved content.

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.
languageCode The language to filter the result set by, or the language of the text on the created image, indicated by a 2-letter language code. Currently supported languages are English (en), Spanish (es), French (fr), Hebrew (he), Russian (ru), Other (--).
pageIndex Page index of the requested result set. Defaults to 0 if not specified.
urlName The URL name of the requested generator, e.g. 'Insanity-Wolf'. Leave as [null] to show all the generators.
days
optional
The time period for which to filter the result set. ([days] == null) for all time.

Example

http://version1.api.memegenerator.net//Instances_Select_ByPopular?languageCode=en&pageIndex=0&urlName=Insanity-Wolf&days=&apiKey=demo

Instances_Select_ByUpvoted

http://version1.api.memegenerator.net//Instances_Select_ByUpvoted

Description

Returns instances upvoted (liked) by a particular user.

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.
byMgUserID The ID of the user that created the content.
pageIndex Page index of the requested result set. Defaults to 0 if not specified.
pageSize Page size of the requested result set. Defaults to 12 if not specified.

Example

http://version1.api.memegenerator.net//Instances_Select_ByUpvoted?byMgUserID=1&pageIndex=0&pageSize=12&apiKey=demo

MgImage_Select

http://version1.api.memegenerator.net//MgImage_Select

Description

Returns information about an image.

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.
mgImageID An ID of an image or video file in the database.

Example

http://version1.api.memegenerator.net//MgImage_Select?mgImageID=42&apiKey=demo

MgImages_Search

http://version1.api.memegenerator.net//MgImages_Search

Description

Search the image database.

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.
q The search query.

Example

http://version1.api.memegenerator.net//MgImages_Search?q=insanity&apiKey=demo

MgUser_Login

http://version1.api.memegenerator.net//MgUser_Login

Description

Returns a session key which can be used for methods that support a logged in user context - methods that accept [sessionKey].

Parameters

username The credentials of a signed up user. Use the website or MgUser_Signup to sign up.
password The credentials of a signed up user. Use the website or MgUser_Signup to sign up.

Example

http://version1.api.memegenerator.net//MgUser_Login?username=test8&password=test8&apiKey=demo

MgUser_Login_Facebook

http://version1.api.memegenerator.net//MgUser_Login_Facebook

Description

Logs in with a facebook access token.

Parameters

facebookAccessToken Get a facebook access token by logging in with the facebook API.

Example

http://version1.api.memegenerator.net//MgUser_Login_Facebook?facebookAccessToken=[facebook access token]&apiKey=demo

MgUser_SignUp

http://version1.api.memegenerator.net//MgUser_SignUp

Description

Create a new user account.

Parameters

email Email address for notification of removal.
username The credentials of a signed up user. Use the website or MgUser_Signup to sign up.
password The credentials of a signed up user. Use the website or MgUser_Signup to sign up.

Example

http://version1.api.memegenerator.net//MgUser_SignUp?email=email@domain.com&username=test8&password=test8&apiKey=demo

MgUser_Update_Image

http://version1.api.memegenerator.net//MgUser_Update_Image

Description

Change a user's profile image.

Parameters

sessionKey A logged in user session key. Use MgUser_Login to get a session key.
image Image url or HTTP posted file.

Example

http://version1.api.memegenerator.net//MgUser_Update_Image?sessionKey=[sessionKey]&image=https://cdn.meme.am/images/983.jpg&apiKey=demo

MgUser_Update_Username

http://version1.api.memegenerator.net//MgUser_Update_Username

Description

Change a user's username. This can be done by the user only once, when setting up their account.

Parameters

sessionKey A logged in user session key. Use MgUser_Login to get a session key.
newUsername The new username.

Example

http://version1.api.memegenerator.net//MgUser_Update_Username?sessionKey=[sessionKey]&newUsername=test8&apiKey=demo

MgUsers_Select_ByPublisher

http://version1.api.memegenerator.net//MgUsers_Select_ByPublisher

Description

Returns the list of users that are following a particular user.

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.
publisherMgUserID The mgUserID of a user that is being subscribed to (followed) or unsubscribed from (unfollowed).

Example

http://version1.api.memegenerator.net//MgUsers_Select_ByPublisher?publisherMgUserID=1&apiKey=demo

MgUsers_Select_BySubscriber

http://version1.api.memegenerator.net//MgUsers_Select_BySubscriber

Description

Returns the list of users that a user follows.

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.
subscriberMgUserID The mgUserID of the user whose subscriptions we're interested in.

Example

http://version1.api.memegenerator.net//MgUsers_Select_BySubscriber?subscriberMgUserID=1&apiKey=demo

Subscription_Generator_Create

http://version1.api.memegenerator.net//Subscription_Generator_Create

Description

Subscribe to a generator. This is not the same as liking (upvoting) a generator. Subscribed generator's instances appear in the user's feed.

Parameters

sessionKey A logged in user session key. Use MgUser_Login to get a session key.
publisherGeneratorID The generatorID of a generator that is being subscribed to or unsubscribed from.

Example

http://version1.api.memegenerator.net//Subscription_Generator_Create?sessionKey=[sessionKey]&publisherGeneratorID=225&apiKey=demo

Subscription_Generator_Delete

http://version1.api.memegenerator.net//Subscription_Generator_Delete

Description

Unsubscribe from a generator.

Parameters

sessionKey A logged in user session key. Use MgUser_Login to get a session key.
publisherGeneratorID The generatorID of a generator that is being subscribed to or unsubscribed from.

Example

http://version1.api.memegenerator.net//Subscription_Generator_Delete?sessionKey=[sessionKey]&publisherGeneratorID=225&apiKey=demo

Subscription_MgUser_Create

http://version1.api.memegenerator.net//Subscription_MgUser_Create

Description

Subscribe to (follow) a user.

Parameters

sessionKey A logged in user session key. Use MgUser_Login to get a session key.
publisherMgUserID The mgUserID of a user that is being subscribed to (followed) or unsubscribed from (unfollowed).

Example

http://version1.api.memegenerator.net//Subscription_MgUser_Create?sessionKey=[sessionKey]&publisherMgUserID=1&apiKey=demo

Subscription_MgUser_Delete

http://version1.api.memegenerator.net//Subscription_MgUser_Delete

Description

Unsubscribe from (unfollow) a user.

Parameters

sessionKey A logged in user session key. Use MgUser_Login to get a session key.
publisherMgUserID The mgUserID of a user that is being subscribed to (followed) or unsubscribed from (unfollowed).

Example

http://version1.api.memegenerator.net//Subscription_MgUser_Delete?sessionKey=[sessionKey]&publisherMgUserID=1&apiKey=demo

Templates_Select_ByUrlName

http://version1.api.memegenerator.net//Templates_Select_ByUrlName

Description

Returns a list of alternative images for a generator.

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.
urlName The URL name of the requested generator, e.g. 'Insanity-Wolf'. Leave as [null] to show all the generators.

Example

http://version1.api.memegenerator.net//Templates_Select_ByUrlName?urlName=Insanity-Wolf&apiKey=demo

Vote

http://version1.api.memegenerator.net//Vote

Description

Vote (like/dislike) on generators and instances. VoteScore can be 1 (like), -1 (dislike) or 0 (no vote). You can vote anonymously, and to vote for a particular user (adds to their favorites), add [username] and [password] fields.

Parameters

sessionKey
optional
A logged in user session key. Use MgUser_Login to get a session key.
entityName Use 'Instance' for instances or 'Generator' for generators.
entityID For entityName=Instance, the entityID would be the instanceID.
voteScore Like (1), dislike (-1) or none (0).

Example

http://version1.api.memegenerator.net//Vote?entityName=Instance&entityID=72628355&voteScore=1&apiKey=demo