API documentation
From Wikiprompt, the Wikipedia of AI prompts. Integrate prompts and metadata into your own apps via a public REST API.
Overview
https://wikiprompt.org/apiAuthentication
Some endpoints require authentication. Include your access token in the Authorization header.
Authorization: Bearer YOUR_ACCESS_TOKENTo generate an access token, sign in and visit your profile to create an API key, or use a Supabase session token.
API v1 (API Key Auth)
/api/v1/promptsAuth requiredCreate a prompt using API key authentication. Generate API keys in your profile.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| title | string | yes | Prompt title (min 3 chars) |
| content | string | yes | The prompt content (min 10 chars) |
| description | string | no | Short description |
| category | string | no | Category: writing, coding, business, marketing, education, creative, productivity, analysis, other |
| tags | string[] | no | Array of tags (max 10) |
| is_public | boolean | no | Make prompt public (default: true) |
Response
{
"success": true,
"message": "Prompt created successfully",
"prompt": {
"id": "uuid",
"title": "string",
"description": "string",
"category": "string",
"tags": ["string"],
"is_public": true,
"created_at": "timestamp"
}
}Example
curl -X POST "https://wikiprompt.org/api/v1/prompts" \
-H "Authorization: Bearer wp_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Python Code Reviewer",
"content": "Act as a senior Python developer...",
"description": "Reviews Python code for best practices",
"category": "coding",
"tags": ["python", "code-review"]
}'/api/v1/promptsAuth requiredList your prompts using API key authentication
Response
{
"success": true,
"count": 10,
"prompts": [
{
"id": "uuid",
"title": "string",
"description": "string",
"category": "string",
"tags": ["string"],
"created_at": "timestamp",
"likes_count": 0,
"views_count": 0
}
]
}Example
curl "https://wikiprompt.org/api/v1/prompts" \
-H "Authorization: Bearer wp_YOUR_API_KEY"Prompts
/api/promptsGet a list of all prompts with pagination and filters
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| page | number | no | Page number (default: 1) |
| limit | number | no | Items per page (default: 20, max: 100) |
| category | string | no | Filter by category |
| search | string | no | Search in title and description |
| sort | string | no | Sort by: newest, oldest, popular, views |
| user_id | string | no | Filter by user ID |
Response
{
"data": [
{
"id": "uuid",
"title": "string",
"description": "string",
"content": "string",
"category": "string",
"tags": ["string"],
"likes_count": 0,
"views_count": 0,
"profiles": {
"id": "uuid",
"username": "string",
"avatar_url": "string"
}
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 100,
"total_pages": 5
}
}Example
curl "https://wikiprompt.org/api/prompts?category=ChatGPT&limit=10"/api/promptsAuth requiredCreate a new prompt
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| title | string | yes | Prompt title (5-100 chars) |
| description | string | yes | Short description (10-500 chars) |
| content | string | yes | The prompt content (20-10000 chars) |
| category | string | yes | Category name |
| tags | string[] | no | Array of tags (max 5) |
| is_paid | boolean | no | Is this a paid prompt? |
| price | number | no | Price in USD (if is_paid) |
Response
{
"data": {
"id": "uuid",
"title": "string",
"description": "string",
"content": "string",
"category": "string",
"tags": ["string"],
"created_at": "timestamp"
}
}Example
curl -X POST "https://wikiprompt.org/api/prompts" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"title": "My Prompt", "description": "A great prompt", "content": "Act as...", "category": "ChatGPT"}'/api/prompts/:idGet a single prompt by ID
Response
{
"data": {
"id": "uuid",
"title": "string",
"description": "string",
"content": "string",
"category": "string",
"tags": ["string"],
"likes_count": 0,
"views_count": 0,
"profiles": {
"id": "uuid",
"username": "string",
"avatar_url": "string",
"bio": "string"
}
}
}Example
curl "https://wikiprompt.org/api/prompts/abc123"/api/prompts/:idAuth requiredUpdate a prompt (owner only)
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| title | string | no | New title |
| description | string | no | New description |
| content | string | no | New content |
| category | string | no | New category |
| tags | string[] | no | New tags |
Response
{
"data": {
"id": "uuid",
"title": "string",
"description": "string",
"content": "string",
"updated_at": "timestamp"
}
}/api/prompts/:idAuth requiredDelete a prompt (owner only)
Response
{
"message": "Prompt deleted successfully"
}/api/prompts/:id/likeAuth requiredLike a prompt
Response
{
"message": "Prompt liked successfully"
}/api/prompts/:id/likeAuth requiredUnlike a prompt
Response
{
"message": "Prompt unliked successfully"
}Users
/api/users/:idGet a user profile with stats
Response
{
"data": {
"id": "uuid",
"username": "string",
"avatar_url": "string",
"bio": "string",
"created_at": "timestamp",
"stats": {
"prompts_count": 10,
"total_likes": 150,
"total_views": 5000
}
}
}Example
curl "https://wikiprompt.org/api/users/abc123"/api/users/:id/promptsGet all prompts by a user
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| page | number | no | Page number |
| limit | number | no | Items per page |
Response
{
"data": [...],
"pagination": {
"page": 1,
"limit": 20,
"total": 50,
"total_pages": 3
}
}Categories
/api/categoriesGet all categories with prompt counts
Response
{
"data": [
{
"id": "ChatGPT",
"name": "ChatGPT",
"description": "Prompts for OpenAI ChatGPT",
"prompts_count": 150
}
],
"total_prompts": 500
}Example
curl "https://wikiprompt.org/api/categories"Search
/api/searchSearch prompts by text, category, or tags
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| q | string | no | Search query (searches title, description, content) |
| category | string | no | Filter by category |
| tags | string | no | Comma-separated tags to filter by |
| page | number | no | Page number |
| limit | number | no | Items per page |
Response
{
"data": [...],
"query": {
"q": "string",
"category": "string",
"tags": ["string"]
},
"pagination": {...}
}Example
curl "https://wikiprompt.org/api/search?q=marketing&category=ChatGPT"Stats
/api/statsGet platform statistics
Response
{
"data": {
"total_prompts": 500,
"total_users": 100,
"total_likes": 2500,
"top_categories": [
{ "name": "ChatGPT", "count": 150 }
],
"category_distribution": {
"ChatGPT": 150,
"Midjourney": 100
}
}
}Example
curl "https://wikiprompt.org/api/stats"Error codes
| Code | Description |
|---|---|
| 200 | Success |
| 201 | Created |
| 400 | Bad Request β invalid parameters |
| 401 | Unauthorized β authentication required |
| 403 | Forbidden β not allowed to access resource |
| 404 | Not Found β resource doesnβt exist |
| 500 | Internal Server Error |
Support
Need help? Contact us at api@wikiprompt.org.