This API allows you to programmatically create memes. You can either use a predefined list of popular meme templates or provide your own custom background image.
API Endpoints
1. List Templates
Fetches a list of all available meme templates. You should call this endpoint first to get the id
for a specific template, which is required for the /generate
endpoint.
- Functionality: Fetches a list of available meme templates.
- Method:
GET
- Endpoint:
/meme/v1/templates
Query Parameters
Parameter | Required | Type | Description |
---|---|---|---|
apikey | Yes | string | Your unique API key. |
Responses
Successful Response (Code 200)
Returns a JSON object containing an array of template objects.
{
"code": "0",
"msg": "success",
"data": {
"templates": [
{
"id": "aag",
"name": "Always Has Been",
"lines": 2,
"styles": [],
"blank": "https://api.juheapi.com/memes/aag.png",
"example": "https://api.juheapi.com/memes/aag/astronaut1/astronaut2.png",
"source": "https://knowyourmeme.com/memes/always-has-been",
"_self": "https://api.juheapi.com/templates/aag"
}
]
}
}
Error Responses
401 Unauthorized
: The providedapikey
is invalid.502 Bad Gateway
: The service failed to fetch templates from its source.
2. Generate Meme from Template
Generates a meme image using a specified template and text. The response will contain a URL to the final image.
- Functionality: Generates a meme from a template.
- Method:
GET
- Endpoint:
/meme/v1/generate
Query Parameters
Parameter | Required | Type | Description |
---|---|---|---|
apikey | Yes | string | Your unique API key. |
template | Yes | string | The id of the meme template (obtained from /templates ). |
top_text | Yes | string | The text to display on the top of the meme. |
bottom_text | No | string | The text to display on the bottom. Use an underscore (_ ) for a blank line. |
format | No | string | Desired image format. Can be png , jpg , gif , webp . Defaults to png . |
font | No | string | The font to use (e.g., impact , notosans ). |
width | No | integer | Desired width of the image in pixels. |
height | No | integer | Desired height of the image in pixels. |
layout | No | string | Controls text positioning (e.g., top ). |
style | No | string | An alternate style for the template or a URL for an image overlay. |
Responses
Successful Response (Code 200)
{
"code": "0",
"msg": "success",
"data": {
"meme_url": "https://api.juheapi.com/Memes/Memes_Everywhere.png?font=impact"
}
}
Error Responses
400 Bad Request
: Required parameters liketemplate
ortop_text
are missing.401 Unauthorized
: The providedapikey
is invalid.
3. Generate Meme with Custom Background
Generates a meme using a custom image from a URL as the background.
- Functionality: Creates a meme with a user-provided background.
- Method:
GET
- Endpoint:
/meme/v1/custom
Query Parameters
Parameter | Required | Type | Description |
---|---|---|---|
apikey | Yes | string | Your unique API key. |
background_url | Yes | string | The URL of the image to use as the background. |
top_text | Yes | string | The text to display on the top of the meme. |
bottom_text | No | string | The text to display on the bottom. Use an underscore (_ ) for a blank line. |
format | No | string | Desired image format. Can be png , jpg , gif , webp . Defaults to png . |
font | No | string | The font to use. |
width | No | integer | Desired width of the image in pixels. |
height | No | integer | Desired height of the image in pixels. |
layout | No | string | Controls text positioning. |
style | No | string | A URL for an image to overlay on top of the custom background. |
Responses
Successful Response (Code 200)
{
"code": "0",
"msg": "success",
"data": {
"meme_url": "https://api.juheapi.com/memes/custom/Hello/World.png?background=https%3A%2F%2Fi.imgur.com%2Fexample.jpg&font=arial"
}
}
Error Responses
400 Bad Request
: Thebackground_url
is missing or has an invalid format.401 Unauthorized
: The providedapikey
is invalid.
⚠️ Important Considerations
- API Key: A valid
apikey
is required for all endpoints. - Standard Workflow: The recommended workflow is to first call
/meme/v1/templates
to find theid
of the template you want, and then use thatid
in your call to/meme/v1/generate
. - Required Text: The
top_text
parameter is always required when generating a meme. - Blank Lines: If you need a meme with only top text, use an underscore (
_
) for thebottom_text
parameter.