MemeStack Imports API
Archive imports (a zip or a list of URLs) for signed-in users.
Operations 6
POST
/v1/imports/{id}/complete-transfer
Finish a zip archive's multipart transfer and start processing
#
Archive imports (a zip or a list of URLs) for signed-in users.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/memestack-ai:memestack-ai-imports-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: MemeStack Imports API
version: 1.0.0
description: 'Visual search engine for memes, infographics, charts, and screenshots. Find images by meaning, the text inside them, or visual similarity. AI-captioned, OCR-indexed, Lightning-ranked. Two tiers: the Open API (/v1) needs no key — the read endpoints the website itself uses, rate-limited per IP address; the Search API (/v2, Tenor v2-compatible) takes an API key, free for 100 calls a day, then paid plans (card or Lightning): https://memestack.ai/developers.'
contact:
name: MemeStack
url: https://memestack.ai
termsOfService: https://memestack.ai/terms
servers:
- url: https://api.memestack.ai
tags:
- name: Imports
description: Archive imports (a zip or a list of URLs) for signed-in users.
paths:
/v1/imports:
post:
tags:
- Imports
summary: Start an archive import (zip or URL list)
description: 'Creator/admin only (fresh DB role, re-checked server-side — not the JWT claim). Async bulk ingestion of up to 10,000 images per job; every image still flows through the normal per-image moderation pipeline (dedup, Gemini risk scan, determineImageStatus). Only one active import per creator at a time (409 IMPORT_ALREADY_ACTIVE). `kind: ''zip''` opens an R2 multipart upload session for the client to stream 90 MB parts into via PUT /v1/imports/{id}/parts/{n}, then POST .../complete-transfer. `kind: ''url_list''` submits the URLs synchronously (each syntactically https-only and SSRF-validated) and enqueues processing immediately.'
security:
- BearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- kind
properties:
kind:
type: string
enum:
- zip
- url_list
size_bytes:
type: integer
description: zip only. Declared archive size; re-validated against the actual assembled object at complete-transfer time. Max 10 GiB.
urls:
type: array
items:
type: string
format: uri
minItems: 1
maxItems: 10000
description: url_list only. Each must be https and pass SSRF validation.
user_context:
type: string
maxLength: 200
description: Optional archive-wide tagging hint passed to the LLM tagger for every image in this import. Same 200-char semantics as the per-file upload hint.
examples:
zip:
value:
kind: zip
size_bytes: 524288000
user_context: 2024 meme dump from Discord archive
url_list:
value:
kind: url_list
urls:
- https://example.com/a.jpg
- https://example.com/b.png
responses:
'201':
description: 'Import created. zip: multipart upload session opened. url_list: manifest written and processing already enqueued.'
content:
application/json:
schema:
type: object
properties:
import_id:
type: string
format: uuid
upload_id:
type: string
description: zip only — R2 multipart upload id, required on every part PUT.
part_size:
type: integer
description: zip only — fixed byte size every non-final part must equal exactly (IMPORT_PART_SIZE, 90 MB).
'400':
description: Validation error (bad kind, size_bytes over the limit, urls empty/over 10,000/non-https/SSRF-blocked).
'403':
description: Caller is not a creator or admin (fresh DB role).
'409':
description: The caller already has an active import.
content:
application/json:
schema:
type: object
properties:
error:
type: string
code:
type: string
enum:
- IMPORT_ALREADY_ACTIVE
operationId: postV1Imports
x-operation-id-source: derived
get:
tags:
- Imports
summary: List the caller's own archive imports
description: Returns up to 20 of the caller's own imports, newest first. No role gate — a non-creator simply has an empty list.
security:
- BearerAuth: []
responses:
'200':
description: The caller's imports.
content:
application/json:
schema:
type: object
properties:
imports:
type: array
items:
$ref: '#/components/schemas/ArchiveImport'
operationId: getV1Imports
x-operation-id-source: derived
/v1/imports/{id}/parts/{n}:
put:
tags:
- Imports
summary: Upload one part of a zip archive's multipart transfer
description: 'Owner only. Non-final parts MUST be exactly IMPORT_PART_SIZE bytes (90 MB); send header `X-Last-Part: 1` on the final part, which may be up to and including that size. Requires a `Content-Length` header (chunked transfer encoding is not supported — the size check runs before any bytes are uploaded). The first accepted part transitions the import from awaiting_transfer to transferring.'
security:
- BearerAuth: []
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
- name: n
in: path
required: true
schema:
type: integer
minimum: 1
description: 1-based part number.
- name: X-Last-Part
in: header
required: false
schema:
type: string
enum:
- '1'
description: Set to 1 on the final part only.
requestBody:
required: true
content:
application/octet-stream:
schema:
type: string
format: binary
responses:
'200':
description: Part accepted.
content:
application/json:
schema:
type: object
properties:
etag:
type: string
'400':
description: Missing/invalid Content-Length, or a non-final part is not exactly IMPORT_PART_SIZE bytes (or the final part exceeds it).
'404':
description: Import not found, or caller is not the owner.
'409':
description: Import is not in awaiting_transfer or transferring status.
operationId: putV1ImportsByIdPartsByN
x-operation-id-source: derived
/v1/imports/{id}/complete-transfer:
post:
tags:
- Imports
summary: Finish a zip archive's multipart transfer and start processing
description: Owner only. Assembles the uploaded parts, re-validates the assembled object's actual size against MAX_ARCHIVE_BYTES, then validates the ZIP central directory via ranged R2 reads (no full-file load) and checks the entry count is between 1 and MAX_IMPORT_ENTRIES. On success, transitions the import to queued and enqueues the first processing chunk. Any validation failure here also moves the import to a terminal `failed` status with `last_error` set.
security:
- BearerAuth: []
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- parts
properties:
parts:
type: array
minItems: 1
items:
type: object
required:
- n
- etag
properties:
n:
type: integer
minimum: 1
etag:
type: string
responses:
'200':
description: Archive validated and processing started.
content:
application/json:
schema:
type: object
properties:
total_entries:
type: integer
'400':
description: parts missing/empty/malformed, assembled object over MAX_ARCHIVE_BYTES, corrupt/unparseable archive (INVALID_ARCHIVE), or entry count outside [1, MAX_IMPORT_ENTRIES].
content:
application/json:
schema:
type: object
properties:
error:
type: string
code:
type: string
enum:
- VALIDATION_ERROR
- INVALID_ARCHIVE
'404':
description: Import not found, or caller is not the owner.
'409':
description: Import is not in awaiting_transfer or transferring status.
operationId: postV1ImportsByIdCompleteTransfer
x-operation-id-source: derived
/v1/imports/{id}/cancel:
post:
tags:
- Imports
summary: Cancel an in-progress import
description: Owner only. Valid from any active status (awaiting_transfer, transferring, queued, running, draining). Already-processed images are left in place — only the remaining chunk chain stops. If the import was still mid-transfer, the R2 multipart upload session is aborted (best-effort).
security:
- BearerAuth: []
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Cancelled.
content:
application/json:
schema:
type: object
properties:
ok:
type: boolean
status:
type: string
enum:
- cancelled
'404':
description: Import not found, or caller is not the owner.
'409':
description: Import is already in a terminal state (completed, failed, cancelled, reverting, or reverted).
operationId: postV1ImportsByIdCancel
x-operation-id-source: derived
/v1/imports/{id}:
get:
tags:
- Imports
summary: Get an archive import's status and live digest
description: Owner or admin only (404 for anyone else — imports have no public visibility tier). The digest is computed live from `images.import_id` (per-status counts), not a denormalized counter, combined with the job row's own cursor/skip/error counters.
security:
- BearerAuth: []
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
responses:
'200':
description: Import detail + digest.
content:
application/json:
schema:
type: object
properties:
import:
$ref: '#/components/schemas/ArchiveImport'
digest:
type: object
properties:
by_status:
type: object
additionalProperties:
type: integer
description: 'Per-image-status counts, e.g. {"approved": 120, "needs_review": 4}.'
skip_count:
type: integer
error_count:
type: integer
errors:
type: array
items:
type: object
properties:
entry:
type: string
reason:
type: string
cursor:
type: integer
total_entries:
type: integer
nullable: true
'404':
description: Import not found, or caller is neither the owner nor an admin.
operationId: getV1ImportsById
x-operation-id-source: derived
components:
schemas:
ArchiveImport:
type: object
properties:
id:
type: string
format: uuid
creator_id:
type: string
format: uuid
kind:
type: string
enum:
- zip
- url_list
status:
type: string
enum:
- awaiting_transfer
- transferring
- queued
- running
- draining
- completed
- failed
- cancelled
- reverting
- reverted
archive_size_bytes:
type: integer
nullable: true
total_entries:
type: integer
nullable: true
description: 'Set once the transfer is validated (zip: central directory entry count; url_list: url count).'
cursor:
type: integer
description: Next entry index the consumer will process.
error_count:
type: integer
skip_count:
type: integer
description: Non-image entries, oversized entries, and dedup skips.
errors:
type: array
items:
type: object
properties:
entry:
type: string
reason:
type: string
description: Capped at 200; overflow only increments error_count.
last_error:
type: string
nullable: true
user_context:
type: string
nullable: true
created_at:
type: string
format: date-time
started_at:
type: string
format: date-time
nullable: true
completed_at:
type: string
format: date-time
nullable: true
example:
id: c3d4e5f6-a7b8-9012-cdef-123456789012
creator_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
kind: zip
status: running
archive_size_bytes: 524288000
total_entries: 4200
cursor: 1150
error_count: 3
skip_count: 40
errors:
- entry: corrupt.jpg
reason: Unsupported or corrupted image format
last_error: null
user_context: 2024 meme dump from Discord archive
created_at: '2026-07-10T09:00:00Z'
started_at: '2026-07-10T09:02:11Z'
completed_at: null
securitySchemes:
BearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: JWT issued by /auth/callback (LNURL) or /auth/email/verify. Also accepted as the httpOnly cookie __Secure-bii-token for same-origin browser requests.
ApiKeyQuery:
type: apiKey
in: query
name: key
ApiKeyHeader:
type: apiKey
in: header
name: X-API-Key
externalDocs:
description: Full API documentation and developer guide
url: https://memestack.ai/developers
x-service-info:
categories:
- media
- search
docs:
homepage: https://memestack.ai/developers
apiReference: https://memestack.ai/llms-full.txt
llms: https://memestack.ai/llms.txt