api / api.yaml
lljz66's picture
assets-only openapi spec
cadd5e9 verified
Raw
History Blame Contribute Delete
1.92 kB
openapi: "3.0.3"
info:
title: Asset Extractor API
version: "2.0.0"
description: |
FastAPI service that extracts assets (image, video, audio, svg/icon, font)
from any URL.
contact:
name: Asset Extractor API
url: https://huggingface.co/spaces/lljz66/api
license:
name: MIT
servers:
- url: https://lljz66-api.hf.space
description: Production
tags:
- name: Assets
description: Asset extraction (image, video, audio, svg/icon, font)
paths:
/assets:
post:
tags: [Assets]
summary: Extract assets from a URL
operationId: extractAssets
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/AssetExtractRequest"
responses:
"200":
description: Assets extracted and grouped
content:
application/json:
schema:
$ref: "#/components/schemas/AssetExtractResponse"
"502":
description: Asset extraction failed
components:
schemas:
AssetExtractRequest:
type: object
required: [url]
properties:
url: { type: string, format: uri }
include_data_uris: { type: boolean, default: false }
groups:
type: array
items: { type: string, enum: [image, video, audio, svg_icon, font] }
AssetExtractResponse:
type: object
properties:
url: { type: string }
title: { type: string, nullable: true }
total: { type: integer }
assets:
type: object
properties:
image: { type: array, items: { type: string } }
video: { type: array, items: { type: string } }
audio: { type: array, items: { type: string } }
svg_icon: { type: array, items: { type: string } }
font: { type: array, items: { type: string } }