{"openapi":"3.1.0","info":{"title":"AniBG API","version":"1","summary":"Free anime backgrounds without characters: search the library and get direct image links.","description":"Read-only and free. No account, no key. Every scene is one place in day, sunset and night versions; each picture is a 1920×1080 JPG with a permanent URL that may be hotlinked or downloaded. Search with free text (q) or filters, then hand the user `image.url` (the picture), `image.download` (the same file as a download) or `page` (the web page). For a picture without any JSON there is https://anibg.com/bg/<words>.jpg, for example https://anibg.com/bg/night-classroom.jpg. The images are free for personal and commercial use without attribution; see `license` in every answer. They are AI-generated. This API cannot generate pictures. When the library has no answer, the response has a `studio` link for the user, who can make it in Studio with credits. Fields of v1 are never removed or renamed; new ones may appear. People's version of this: https://anibg.com/developers/","license":{"name":"AniBG License (images)","url":"https://anibg.com/license/"}},"servers":[{"url":"https://anibg.com"}],"externalDocs":{"description":"For people","url":"https://anibg.com/developers/"},"paths":{"/api/v1/search":{"get":{"operationId":"searchBackgrounds","summary":"Search backgrounds","description":"Free text and filters together. Words in q that name a time (\"night\", \"dusk\", \"rainy\", 夜, 夕方) or a place (\"alley\", \"temple\", \"sakura\", 教室, 海辺) act as the time or place filter when that parameter is not given; `query` in the answer shows what was understood. Each result is a SearchHit: the scene without its long texts, `image` (the variant that answers the query: the time asked for when the scene has it, else day) in full, the other times as links, and `scene`, the URL of the full record. Ordered by how well the words match, then the place's cover scene, then id. With nothing in q and no filters, the whole library is listed.","parameters":[{"name":"q","in":"query","required":false,"description":"Free text in English, Japanese or Chinese: a place, a time, things in the picture. Words like \"anime\", \"background\" and \"free\" are ignored.","schema":{"type":"string","maxLength":200},"example":"classroom at night"},{"name":"place","in":"query","required":false,"description":"Only scenes of this place. GET /api/v1/places lists them with counts.","schema":{"type":"string","enum":["classroom","bedroom","city-street","rooftop","cafe","train-station","shrine","beach","forest","living-room","convenience-store","countryside","school","sky","park","house","cherry-blossom"]},"example":"classroom"},{"name":"time","in":"query","required":false,"description":"The time of day or weather of the picture. Every scene has day, sunset and night. Rain and snow are made in Studio: asking for them returns the scenes in daylight plus a Studio link for the user.","schema":{"type":"string","enum":["day","sunset","night","rain","snow"]},"example":"night"},{"name":"tag","in":"query","required":false,"description":"Only scenes with this tag.","schema":{"type":"string","enum":["autumn","city","exterior","home","interior","nature","rural","school","sea","shop","sky","spring","traditional","travel","winter"]},"example":"autumn"},{"name":"use","in":"query","required":false,"description":"Only scenes suited to this use.","schema":{"type":"string","enum":["visual-novels","vtubers","zoom","desktop","phone"]},"example":"visual-novels"},{"name":"style","in":"query","required":false,"description":"Only scenes drawn in this style.","schema":{"type":"string","enum":["cel","cinematic","painted","painterly","pixel","retro","watercolor"]},"example":"painted"},{"name":"lang","in":"query","required":false,"description":"Language of titles, summaries and place names (ja, zh), and of `page` and `markdown`, which then point at the translated page. Picture texts (alt, descriptions) are English where a translation does not exist yet.","schema":{"type":"string","enum":["en","ja","zh"],"default":"en"},"example":"en"},{"name":"limit","in":"query","required":false,"description":"How many results, 1 to 50.","schema":{"type":"integer","minimum":1,"maximum":50,"default":10},"example":5},{"name":"offset","in":"query","required":false,"description":"How many results to skip, for the next page.","schema":{"type":"integer","minimum":0,"default":0},"example":0}],"responses":{"200":{"description":"Matching scenes, best first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResult"}}}},"400":{"description":"A parameter has a value that is not allowed. The message lists the allowed ones.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 300 requests a minute from one address. Wait for the number of seconds in retry-after.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/scenes/{id}":{"get":{"operationId":"getScene","summary":"One scene with all its pictures","parameters":[{"name":"id","in":"path","required":true,"description":"Scene id, as in search results (\"bg-001\").","schema":{"type":"string","pattern":"^bg-[0-9]+$"},"example":"bg-001"},{"name":"lang","in":"query","required":false,"description":"Language of titles, summaries and place names (ja, zh), and of `page` and `markdown`, which then point at the translated page. Picture texts (alt, descriptions) are English where a translation does not exist yet.","schema":{"type":"string","enum":["en","ja","zh"],"default":"en"},"example":"en"}],"responses":{"200":{"description":"The scene.","content":{"application/json":{"schema":{"type":"object","required":["scene","license"],"properties":{"scene":{"$ref":"#/components/schemas/Scene"},"license":{"$ref":"#/components/schemas/License"}}}}}},"400":{"description":"A parameter has a value that is not allowed. The message lists the allowed ones.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"There is no scene with this id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 300 requests a minute from one address. Wait for the number of seconds in retry-after.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/places":{"get":{"operationId":"listPlaces","summary":"Places, times, tags, uses and styles, with counts","description":"Everything that can be filtered by, with how many scenes have it. Each place has a cover picture and its page.","parameters":[{"name":"lang","in":"query","required":false,"description":"Language of titles, summaries and place names (ja, zh), and of `page` and `markdown`, which then point at the translated page. Picture texts (alt, descriptions) are English where a translation does not exist yet.","schema":{"type":"string","enum":["en","ja","zh"],"default":"en"},"example":"en"}],"responses":{"200":{"description":"The filters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Places"}}}},"400":{"description":"A parameter has a value that is not allowed. The message lists the allowed ones.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 300 requests a minute from one address. Wait for the number of seconds in retry-after.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/random":{"get":{"operationId":"randomBackground","summary":"A random background","description":"A different scene on every request (not cached). The filters narrow it down.","parameters":[{"name":"place","in":"query","required":false,"description":"Only scenes of this place. GET /api/v1/places lists them with counts.","schema":{"type":"string","enum":["classroom","bedroom","city-street","rooftop","cafe","train-station","shrine","beach","forest","living-room","convenience-store","countryside","school","sky","park","house","cherry-blossom"]},"example":"classroom"},{"name":"time","in":"query","required":false,"description":"The time of day or weather of the picture. Every scene has day, sunset and night. Rain and snow are made in Studio: asking for them returns the scenes in daylight plus a Studio link for the user.","schema":{"type":"string","enum":["day","sunset","night","rain","snow"]},"example":"night"},{"name":"tag","in":"query","required":false,"description":"Only scenes with this tag.","schema":{"type":"string","enum":["autumn","city","exterior","home","interior","nature","rural","school","sea","shop","sky","spring","traditional","travel","winter"]},"example":"autumn"},{"name":"use","in":"query","required":false,"description":"Only scenes suited to this use.","schema":{"type":"string","enum":["visual-novels","vtubers","zoom","desktop","phone"]},"example":"visual-novels"},{"name":"style","in":"query","required":false,"description":"Only scenes drawn in this style.","schema":{"type":"string","enum":["cel","cinematic","painted","painterly","pixel","retro","watercolor"]},"example":"painted"},{"name":"lang","in":"query","required":false,"description":"Language of titles, summaries and place names (ja, zh), and of `page` and `markdown`, which then point at the translated page. Picture texts (alt, descriptions) are English where a translation does not exist yet.","schema":{"type":"string","enum":["en","ja","zh"],"default":"en"},"example":"en"}],"responses":{"200":{"description":"One scene, with `image` at the time asked for (else day).","content":{"application/json":{"schema":{"type":"object","required":["scene","license"],"properties":{"scene":{"$ref":"#/components/schemas/Result"},"license":{"$ref":"#/components/schemas/License"},"studio":{"$ref":"#/components/schemas/Studio"}}}}}},"400":{"description":"A parameter has a value that is not allowed. The message lists the allowed ones.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No scene matches these filters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"More than 300 requests a minute from one address. Wait for the number of seconds in retry-after.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/license":{"get":{"operationId":"getLicense","summary":"What the images may be used for","responses":{"200":{"description":"The license.","content":{"application/json":{"schema":{"type":"object","required":["license"],"properties":{"license":{"$ref":"#/components/schemas/License"}}}}}}}}}},"components":{"schemas":{"Image":{"type":"object","description":"One picture of a scene: the scene at one time of day.","required":["time","url","width","height","format","preview","thumbnail","download","alt","description","palette","colors"],"properties":{"time":{"type":"string","enum":["day","sunset","night","rain","snow"]},"url":{"type":"string","description":"The picture, 1920×1080 JPG. Permanent: the file under this URL never changes. Free to hotlink.","format":"uri"},"width":{"type":"integer","example":1920},"height":{"type":"integer","example":1080},"format":{"type":"string","description":"File format of `url`.","enum":["jpg"]},"preview":{"type":"string","description":"1280×720 WebP.","format":"uri"},"thumbnail":{"type":"string","description":"640×360 WebP.","format":"uri"},"download":{"type":"string","description":"The same JPG, sent as a file download with a descriptive file name.","format":"uri"},"alt":{"type":"string","description":"Alt text: place, time and what identifies the picture, in one phrase."},"description":{"type":"string","description":"What the light, sky and weather do at this time. May be empty while a scene has no written description yet."},"palette":{"type":"string","description":"Colour words, most dominant first."},"colors":{"type":"array","items":{"type":"string","pattern":"^#[0-9a-f]{6}$"},"description":"Five dominant colours as hex, most dominant first."}}},"Studio":{"type":"object","description":"A link for the user, when the library has no exact answer. Agents cannot generate; the user can, in Studio, with credits or a free preview.","required":["url","note"],"properties":{"url":{"type":"string","description":"Opens Studio filled in.","format":"uri"},"note":{"type":"string","description":"What the link does, in one or two sentences."}}},"Scene":{"type":"object","description":"One place, drawn once and relit for each time of day: the pictures line up exactly.","required":["id","title","summary","place","place_name","style","tags","uses","objects","composition","style_note","times","page","markdown","images","set_zip","studio"],"properties":{"id":{"type":"string","description":"Stable id, shown on the site as the board code (bg-014 is BG-014).","example":"bg-001"},"title":{"type":"string","description":"Short name of the scene."},"summary":{"type":"string","description":"One sentence on what is in the picture."},"place":{"type":"string","enum":["classroom","bedroom","city-street","rooftop","cafe","train-station","shrine","beach","forest","living-room","convenience-store","countryside","school","sky","park","house","cherry-blossom"],"description":"Place slug."},"place_name":{"type":"string","description":"Place, for people."},"style":{"type":"string","enum":["cel","cinematic","painted","painterly","pixel","retro","watercolor"],"description":"How it is drawn, as a slug."},"tags":{"type":"array","items":{"type":"string","enum":["autumn","city","exterior","home","interior","nature","rural","school","sea","shop","sky","spring","traditional","travel","winter"]},"description":"Tags."},"uses":{"type":"array","items":{"type":"string","enum":["visual-novels","vtubers","zoom","desktop","phone"]},"description":"What it suits."},"objects":{"type":"array","items":{"type":"string"},"description":"Things in the picture, most prominent first."},"composition":{"type":"string","description":"Camera height and direction, what is where."},"style_note":{"type":"string","description":"How it is drawn, one sentence."},"times":{"type":"array","items":{"type":"string","enum":["day","sunset","night","rain","snow"]},"description":"The times this scene exists in."},"page":{"type":"string","description":"The web page of the scene.","format":"uri"},"markdown":{"type":"string","description":"The same page as Markdown.","format":"uri"},"images":{"type":"array","items":{"$ref":"#/components/schemas/Image"},"description":"One picture per time."},"set_zip":{"type":"string","description":"Zip of the 1920 JPGs of all times, named for Ren'Py (\"bg <slug> <time>.jpg\"), with the license text.","format":"uri"},"studio":{"type":"object","description":"Links for the user to change this scene in Studio (paid; agents cannot generate).","required":["url","rain","snow","phone","4k","note"],"properties":{"url":{"type":"string","description":"The scene in Studio.","format":"uri"},"rain":{"type":"string","description":"The scene in rain.","format":"uri"},"snow":{"type":"string","description":"The scene in snow.","format":"uri"},"phone":{"type":"string","description":"A 9:16 phone crop.","format":"uri"},"4k":{"type":"string","description":"3840×2160.","format":"uri"},"note":{"type":"string","description":"What the links do."}}}}},"Result":{"description":"A scene plus the picture that answers the query (random).","allOf":[{"$ref":"#/components/schemas/Scene"},{"type":"object","required":["image"],"properties":{"image":{"$ref":"#/components/schemas/Image"}}}]},"SearchHit":{"type":"object","description":"One search result: the scene without its long texts, the picture that answers the query in full, and every time as a link. `scene` is the full record.","required":["id","title","summary","place","place_name","style","tags","objects","times","page","markdown","scene","image","images"],"properties":{"id":{"type":"string","description":"Stable id (bg-014 is BG-014 on the site).","example":"bg-001"},"title":{"type":"string","description":"Short name of the scene, in `lang`."},"summary":{"type":"string","description":"One sentence on what is in the picture, in `lang`."},"place":{"type":"string","enum":["classroom","bedroom","city-street","rooftop","cafe","train-station","shrine","beach","forest","living-room","convenience-store","countryside","school","sky","park","house","cherry-blossom"],"description":"Place slug."},"place_name":{"type":"string","description":"Place, for people, in `lang`."},"style":{"type":"string","enum":["cel","cinematic","painted","painterly","pixel","retro","watercolor"],"description":"How it is drawn, as a slug."},"tags":{"type":"array","items":{"type":"string","enum":["autumn","city","exterior","home","interior","nature","rural","school","sea","shop","sky","spring","traditional","travel","winter"]},"description":"Tags."},"objects":{"type":"array","items":{"type":"string"},"description":"Things in the picture, most prominent first."},"times":{"type":"array","items":{"type":"string","enum":["day","sunset","night","rain","snow"]},"description":"The times this scene exists in."},"page":{"type":"string","description":"The web page of the scene, in `lang`.","format":"uri"},"markdown":{"type":"string","description":"The same page as Markdown.","format":"uri"},"scene":{"type":"string","description":"GET this for the full Scene: every picture with its texts, composition, Studio links.","format":"uri"},"image":{"$ref":"#/components/schemas/Image"},"images":{"type":"array","items":{"type":"object","required":["time","url"],"properties":{"time":{"type":"string","enum":["day","sunset","night","rain","snow"]},"url":{"type":"string","description":"The 1920×1080 JPG of this time. Permanent.","format":"uri"}}},"description":"Every time of the scene, including the one in `image`."}}},"Cover":{"type":"object","description":"A picture as a link: the full record is at /api/v1/scenes/{scene}.","required":["scene","time","url","alt"],"properties":{"scene":{"type":"string"},"time":{"type":"string","enum":["day","sunset","night","rain","snow"]},"url":{"type":"string","description":"1920×1080 JPG. Permanent.","format":"uri"},"alt":{"type":"string"}}},"License":{"type":"object","description":"The terms of every library image. Tell the user if they plan to resell images or train models.","required":["name","url","commercial_use","attribution_required","modification","redistribution_as_is","ai_training_dataset","ai_generated","summary"],"properties":{"name":{"type":"string","description":"Name of the license.","const":"AniBG License"},"url":{"type":"string","description":"The license in full, plain words.","format":"uri"},"commercial_use":{"type":"boolean","const":true,"description":"Games you sell, monetised streams and videos, client work."},"attribution_required":{"type":"boolean","const":false,"description":"Credit is optional: \"Background: AniBG (anibg.com)\"."},"modification":{"type":"boolean","const":true,"description":"Edit, crop, repaint."},"redistribution_as_is":{"type":"boolean","const":false,"description":"The images may not be sold or given away on their own or as a pack."},"ai_training_dataset":{"type":"boolean","const":false,"description":"The images may not be used as a dataset to train image models."},"ai_generated":{"type":"boolean","const":true,"description":"Every image is AI-generated."},"summary":{"type":"string","description":"The terms in three sentences."}}},"SearchResult":{"type":"object","required":["query","total","offset","limit","results","license"],"properties":{"query":{"type":"object","description":"The query as understood: explicit filters and those read from q, and the words left to match. null = not filtered.","properties":{"q":{"type":"string"},"place":{"type":["string","null"]},"time":{"type":["string","null"]},"tag":{"type":["string","null"]},"use":{"type":["string","null"]},"style":{"type":["string","null"]},"lang":{"type":"string","enum":["en","ja","zh"]},"words":{"type":"array","items":{"type":"string"},"description":"Words of q that were matched against the texts."},"ignored":{"type":"array","items":{"type":"string"},"description":"Words of q that nothing in the library has; they were left out."}}},"total":{"type":"integer","description":"All matches; `results` is one page of them."},"offset":{"type":"integer"},"limit":{"type":"integer"},"results":{"type":"array","items":{"$ref":"#/components/schemas/SearchHit"},"description":"Best first."},"license":{"$ref":"#/components/schemas/License"},"studio":{"$ref":"#/components/schemas/Studio","description":"Present when nothing matched, or the time asked for (rain, snow) does not exist in the library."}}},"Places":{"type":"object","required":["places","times","tags","uses","styles"],"properties":{"places":{"type":"array","items":{"type":"object","required":["slug","name","description","scenes","cover","page","markdown"],"properties":{"slug":{"type":"string","enum":["classroom","bedroom","city-street","rooftop","cafe","train-station","shrine","beach","forest","living-room","convenience-store","countryside","school","sky","park","house","cherry-blossom"]},"name":{"type":"string"},"description":{"type":"string","description":"What the place contains."},"scenes":{"type":"integer"},"cover":{"description":"The picture that stands for the place, in daylight.","$ref":"#/components/schemas/Cover"},"page":{"type":"string","description":"The place on the web.","format":"uri"},"markdown":{"type":"string","description":"The same page as Markdown.","format":"uri"}}},"description":"Places that have scenes."},"times":{"type":"array","items":{"type":"object","properties":{"time":{"type":"string","enum":["day","sunset","night","rain","snow"]},"name":{"type":"string"},"scenes":{"type":"integer"}}},"description":"Times, with how many scenes exist in each."},"tags":{"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"scenes":{"type":"integer"}}},"description":"Tags, most used first."},"uses":{"type":"array","items":{"type":"object","properties":{"use":{"type":"string"},"name":{"type":"string"},"page":{"type":"string","format":"uri"},"scenes":{"type":"integer"}}},"description":"Uses, with their pages."},"styles":{"type":"array","items":{"type":"object","required":["style","name","description","page","markdown","scenes"],"properties":{"style":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"page":{"type":"string","format":"uri"},"markdown":{"type":"string","format":"uri"},"scenes":{"type":"integer"}}},"description":"Drawing styles, each with its page."}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","description":"Code.","enum":["bad_request","not_found","method","rate_limited"]},"message":{"type":"string","description":"A plain sentence on what went wrong and what is allowed."}}}}}}