API Code Examples
API Code Examples
This section provides examples of how to interact with the Meme Token Generator API using different programming languages and frameworks.
cURL Example
Here are several ways to use cURL to interact with the API:
Basic Request
curl -X POST \
https://ai.justpump.pro \
-H 'Content-Type: application/json' \
-d '{
"userDescription": "A token based on flying pandas eating bamboo in space"
}'Save Response to File
curl -X POST \
https://ai.justpump.pro \
-H 'Content-Type: application/json' \
-d '{
"userDescription": "A token based on flying pandas eating bamboo in space"
}' \
-o response.jsonWith Pretty Printing
Windows Command Prompt
With Verbose Output
Example Response
Notes for cURL Usage
Make sure to properly escape quotes in the JSON payload
Use
-vflag for debugging and seeing detailed request/response informationWindows users should use
^instead of\for line continuationThe
-oflag can be used to save the response to a fileUse
json_pporjqfor prettier JSON output formatting
JavaScript / Node.js Example
Using the native fetch API to make requests to the endpoint.
Python Example
Using the requests library to interact with the API.
React/TypeScript Component Example
A complete React component with TypeScript support and error handling.
Example Response
Here's what a successful response looks like:
Error Handling
All examples include proper error handling for common scenarios:
Network errors
Invalid responses
API errors
Validation errors
Make sure to implement appropriate error handling in your production code.
Dependencies
React:
reactandtypescriptNode.js: No additional dependencies needed
Notes
All examples assume you have the necessary dependencies installed
ded for better development experience
Examples include basic error handling and loading states
All requests use the POST method with JSON content type
Additional Resources
API Documentation
Last updated