External API access is currently experimental and documentation is subject to change at any time. For any questions or support, please join our official Discord server.
Navigate to your account's API access page to retrieve a newly generated API key which will be tied to your PonyAggregate account. API keys last indefinitely and can only be viewed once. Please ensure to treat your API key as a password as it can be used to authenticate with your account via HTTP requests.
Key-based API access may be revoked at any time by the PonyAggregate moderation team.
After obtaining your API key from the appropriate location, store it in a secure location for use with your code (e.g. an environemnt variable), as it can be used to compromise your PonyAggregate account.
Every request made with an API key requires the usage of the Authorization: Bearer <api key> scheme. Session-based cookies are not allowed.
Example cURL request:
curl -X POST https://ponyaggregate.com/api/users/me -H "Authorization: Bearer thisisanexamplekey123"This section covers some essential information about how to appropriately use the PonyAggregate API without facing account moderation and other penalties.
The API request rate limit is currently set to 70 requests every 5 seconds (14 requests per second).
The following API endpoint can be used to authenticate as a user given a username and password.
POST
/api/auth/loginExample request body
{ "identifier": "username",
"password": <password>,
"cfKey": "auth",
"cfToken": <Cloudflare Turnstile token>
}
Upon successful authentication, a Set-Cookie header will be returned by the server containing a session cookie. Each session cookie expires after exactly 4 months.
POST /api/submissions/newCreates a new submission with the provided metadata.
POST
/api/submissions/newExample request body
{ "name": "Beat It PMV",
"description": <required field>,
"tags": ["pmv"],
"source": "https://www.youtube.com/watch?v=gmJ2Bkx2C5A",
"attachments": <array of attachment UUIDs>,
"thumbnailMime": "image/webp",
"thumbnail": <Base64 encoded string>,
"rating": <SubmissionRating>,
"creator": "animated james",
"submissionType": <SubmissionType>,
"originalDate": <Unix epoch timestamp>,
"cfKey": "invisible",
"cfToken": <Cloudflare Turnstile token>,
}
SafeSuggestiveMaturePhotoArtworkVideoAniumationAudioMusicThreadFanficModelGameOtherPOST /api/submissions/import/derpibooruImports an image from Derpibooru.org with the specified image ID.
POST
/api/submissions/import/derpibooruExample request body
{ "imageId": <image id>, // from https://derpibooru.org/images/<image id>
"cfKey": "invisible",
"cfToken": <Cloudflare Turnstile token>
}
Example response body
{ "attachment": { "uuid": <attachment uuid>,
"mime": <image MIME type>
},
"submission": { "name": <image name>,
"type": <"Artwork" | "Animation">,
"description": <image description>,
"rating": <SubmissionRating>,
"tags": [<image tags>],
"creatorName": <derpibooru image uploader>,
"source": "https://derpibooru.org/images/<image id>",
"originalDate": <derpibooru image date>,
"thumbnail": <Base64 encoded string of image>,
"thumbnailMime": <image MIME type>,
}
}
This endpoint uploads the image directly from Derpibooru to the archive and returns auto-generated submission metadata that resembles the image's metadata on Derpibooru. However, a submission is not actually created, and it is expected that you call /api/submissions/new
POST /api/submissions/import/ponytubeImports an image from Pony.Tube with the specified image ID.
POST
/api/submissions/import/ponytubeExample request body
{ "videoId": <video id>, // from https://pony.tube/w/<video id>
"cfKey": "invisible",
"cfToken": <Cloudflare Turnstile token>,
}
Example response body
{ "attachment": { "uuid": <attachment uuid>,
"mime": <video MIME type>
},
"submission": { "name": <video name>,
"type": "Video",
"tags": ["pony.tube import", <video tags>],
"description": <video description>,
"rating": <SubmissionRating>,
"creatorName": <video uploader username>,
"source": "https://pony.tube/w/<video id>",
"originalDate": <video upload date>,
"thumbnail": <Base64 encoded string of video preview>,
"thumbnailMime": <MIME type of video preview>
}
}
Similarly to the Derpibooru import endpoint, this endpoint also returns auto-generated sumbission metadata and imports the highest quality video track available from Pony.Tube. However, you are expected to create the submission via /api/submissions/new
POST /api/submissions/[id]/reviseEdits a submission with the specified id
POST
/api/submissions/[id]/reviseExample request body
{ "name": <new name>,
"description": <new description>,
"tags": [<new tags>],
"source": <new source>,
"attachments": [<new attachments>],
"thumbnailMime": <new thumbnail MIME type>,
"thumbnail": <new thumbnail>,
"rating": <new rating: SubmissionRating>,
"creator": <new creator>,
"submissionType": <new type: SubmissionType>,
"originalDate": <new date>,
"newAttachments": [<new attachment keys>],
"removedAttachments": [<attachment keys to remove>],
"cfKey": "invisible",
"cfToken": <Cloudflare Turnstile token>,
}
DELETE /api/submissions/[id]/deleteSimply deletes the submission with the specified id. Returns status 200 upon successful deletion.
DELETE
/api/submissions/[id]/deleteStatus 400 - Bad request or internal server error.Status 403 - You are not allowed to delete the submission.Status 404 - The submission could not be found given the specified idPOST /api/attachments/createReturns an attachment UUID and presigned URL for attachment uploads.
POST
/api/attachments/createExample request body
{ "name": <attachment name>,
"mime": <attachment MIME type>,
"size": <attachment size in bytes>,
"cfKey": "invisible",
"cfToken": <Cloudflare Turnstile token>
}
Example response body
{ "presignedUrl": <presigned url>,
"uuid": <new attachment UUID>
}
Files can then be uploaded to the presigned url and can be finalized with the server by making a request to /api/attachments/[name]/finalize
PUT /api/attachments/[name]/finalizeFinalizes the attachment upload process after an attachment with a UUID of namewas uploaded to the S3 bucket with the presigned URL returned by /api/attachments/create.
PUT
/api/attachments/[name]/finalizePOST /api/lists/newCreates a new submissions list with the provided metadata.
POST
/api/lists/newExample request body
{ "name": <list name, 1-100 characters>,
"description": <list description, up to 10,000 characters>,
"rating": <SubmissionRating>,
"public": <true | false>,
"collaborative": <true | false>,
"collaborativeUsernames": [<usernames list>],
"cfKey": "invisible",
"cfToken": <Cloudflare Turnstile token>
}
PUT /api/lists/[id]/editEdits the submissions list with the specified id.
PUT
/api/lists/[id]/editExample request body
{ "name": <new name, 1-100 characters>,
"description": <new description, up to 10,000 characters>,
"rating": <new rating: SubmissionRating>,
"public": <true | false>,
"collaborative": <true | false>,
"cfKey": "invisible",
"cfToken": <Cloudflare Turnstile token>
}
PUT
/api/lists/[id]/submissions/addExample request body
{ "submissionIds": [<ids>]
}
DELETE
/api/lists/[id]/submissions/removeExample request body
{ "submissionIds": [<ids>]
}
PUT
/api/lists/[id]/collaborators/addExample request body
{ "collaboratorUsernames": [<usernames>]
}
DELETE
/api/lists/[id]/collaborators/removeExample request body
{ "collaboratorUsernames": [<usernames>]
}