Follow merged and deleted series

Recipes for specific tasks against the API.

When two records turn out to be the same series, one is merged into the other. If you store series ids, check them now and then and move merged ids to their replacement.

How to spot a merge#↑

Every series has a state:

state Meaning
active A normal series.
merged Folded into another series. merged_with holds its id.
deleted Removed. There is nothing to move to.

Series 728 was merged into 377:

curl "https://api.mangabaka.org/v2/series/728"

The response, trimmed to the fields that matter here:

{
	"status": 200,
	"data": {
		"id": 728,
		"state": "merged",
		"merged_with": 377
	}
}

Which endpoints show merged series#↑

Endpoint Merged and deleted series
Get a series by its ID Returned, with state and merged_with
Batch get Left out of data, no error
Search, match Left out
Source lookups such as AniList Left out, unless you pass with_merged_series=true

So a batch request for id=728&id=377 returns only 377. A missing id in a batch response means the series is merged, deleted, or does not exist. Ask the single-series endpoint to find out which.

A single-series request answers 404 when there is no series with that id at all.

Update procedure#↑

  1. Batch your stored ids, 50 per request, with Batch get.
  2. Note every id you asked for that is missing from data.
  3. Fetch each missing id with Get a series by its ID.
  4. If state is merged, replace your stored id with merged_with. Fetch that id too and repeat until state is active.
  5. If state is deleted, or the response is 404, drop the id or flag it for your user.

If you also store provider ids, a source lookup with with_merged_series=true shows the merged and active records side by side:

curl "https://api.mangabaka.org/v1/source/anilist/30013?with_merged_series=true"