Skip to content

Models Reference

Function Wrappers

Most of the specialized object types have a corresponding wrapper functions. While developing a source, these wrappers seem to be nonfunctional. However, these wrappers are crucial, as they are the bridge between the JavaScript layer that the source runs on, and the Swift layer that the app runs on. The wrappers convert the Javascript object into a Swift object that the app can use.

Warning

Not wrapping a created object with a wrapper function will cause the app to crash once the app gets the object. There will also be no way to find out which object was the cause of the crash, and the unit tests will not easily reveal the missing wrapper, as the conversion is only done within the app. The crashing behavior may be fixed in a later version of the app, where the source will just fail instead of bringing the app down along with it.

Tip

Every time an object is created using braces ({}), it should always be wrapped.

List of Wrapper Functions

Chapter

The Chapter object contains most metadata about a chapter. Different chapters are differentiated by the Chapter ID. Changing the chapter ID will cause a different chapter entry to show up, even if another chapter has the same chapter number.

Required Fields

NameTypeDescription
idStringA given identifier of this chapter. This may be unique to the source. For example, one source may use Chapter-1 in its URLs to identify this chapter, whereas other sources may use some numeric identifier, such as 123456.
mangaIdStringThe given identifier of the Manga that owns this chapter. This should match the id of the manga that the chapter is for.
chapNumNumberThe number of the chapter, which is used for sorting the chapter list. The number may be a decimal. Multiple chapters with the same number will be sorted based on their volume number or the group that created the chapter, if it exists. Otherwise, the chapters will be sorted on the chapter ID.
langCodeLanguageCodeThe language code which this chapter is associated with. This is used along with the Content settings option to filter the chapter list so only chapters for the languages specified by the user are shown.

Optional Fields

NameTypeDescription
nameStringThe title of the chapter.
volumeNumberThe volume that the chapter belongs to. It is recommended to leave the volume number out if every chapter does not have a corresponding volume number, as the volume number interferes with sorting.
groupStringThe group that posted the chapter.
timeDate objectThe date that the chapter is published. If omitted, the chapter will have a creation of the time when the chapter list was loaded.

ChapterDetails

The ChapterDetails object contains a small amount of metadata about the chapter and contains the list of pages.

Required Fields

NameTypeDescription
idStringThe chapter ID of the chapter that the object respresents.
mangaIdStringThe given identifier of the Manga that owns this chapter. This should match the id of the manga that the chapter is for.
pagesString ArrayThe list of pages in the chapter. The pages are ordered by the index of the array, where the 0th index is the first page, and so on. Each item should be a link to the image file that represents the page.
longStripBooleanIndicates whether or not the chapter should be rendered in Long Strip Mode. A long strip is a webtoon or any other form of manga that uses very tall but narrow images.

IconText

An icon text represents a line of text and an optional icon.

Required Fields

NameTypeDescription
textStringThe text that the object represents.

Optional Fields

NameTypeDescription
iconStringTHe icon that the object represents.

LanguageCode

A string enum defining full language names, and the corresponding language code.

Warning

Some full language names have typos. These may be fixed in a future version.

Values

Language NameLanguage Code
BENGALIbd
BRAZILIANbr
BULGARIANbg
CHINEESEcn
CHINEESE_HONGKONGhk
CZECHcz
DANISHdk
DUTCHnl
ENGLISHgb
FINNISHfi
FRENCHfr
GERMANde
GREEKgr
HUNGARIANhu
INDIANin
INDONESIANid
IRANir
ISRELIil
ITALIANit
JAPANESEjp
KOREANkr
LITHUANIANlt
MALAYmy
MEXIANmx
MONGOLIANmn
NORWEGIANno
PHILIPPINEph
POLISHpl
PORTUGUESEpt
ROMANIANro
RUSSIANru
SAMIsi
SANSKRITsa
SPANISHes
THAIth
TURKISHtr
UKRAINIANua
UNKNOWN_unknown
VIETNAMESEvn
WELSHgb

Manga

The Manga object contains most metadata about a manga. Different manga objects are differentiated by the Manga ID, and changing the Manga ID will return a different manga.

Required Fields

NameTypeDescription
idStringThe given identifier of this Manga. This may be unique to the source which uses it. For example, one source may use the value '1234' to identify a manga, whereas another one may use the value 'One-Piece' to identify
imageStringA URL pointing to a thumbnail which can be displayed to present the manga.
ratingNumberThe rating which users have given this manga. Use 0 if the manga is unrated or the source has no rating system in place.
statusMangaStatusThe status of the manga, indicating if the manga is ongoing or completed.
titlesString ArrayAn array of titles which this Manga is called. The first title is the manga's official title, while extra entries are treated as alternate titles for the manga.

Optional Fields

NameTypeDescription
langFlagStringA language code for the Manga, if one is available. Examples: en is English, jp is Japanese, etc.
langNameStringThe full name of the manga's language. English, Japanese, etc.
artistStringThe name of the manga's artist. Multiple artists should be concatenated into a String with a delimiter such as a comma separating each artist.
authorStringThe name of the manga's author. Multiple authors should be concatenated into a String with a delimiter such as a comma separating each author.
avgRatingNumberThe average rating of the manga. May be the same value as the rating field.
coversString ArrayAdditional covers for the manga. Each entry is a URL pointing to the cover image.
descStringA description of this manga.
followsNumberThe number of followers of the manga if the source supports following mangas and displays follower counts.
tagsTagSection ArrayAn array containing the various tag sections. Only the first entry is actually displayed in the app.
usersNumberThe number of users subscribed to the manga. May be the same value as the follows field.
viewsNumberThe number of views this manga has had.
hentaiBooleanWhether or not this manga is a hentai. If it is set to true, the manga will not be visible to the user unless the user enables mature manga.
relatedIdsString ArrayThe IDs of related manga.
lastUpdateStringA string showing when the manga was last updated. It might either be an absolute date (March 1, 2021) or a relative date (2 days ago).

MangaStatus

An integer enum representing the various statuses a manga can have.

Values

NameValueDescription
Completed0A manga that has officially completed production. Does not mean that the current chapter list contains all chapters that the manga will ever have, as sources can add special pages posted on social media or scanlations for chapters in languages other than the official release language.
Ongoing1A manga that is still releasing chapters.

MangaTile

A tile representing a manga. This is a more barebones version of the Manga object, intended for things like homepages and searches which will not return most manga metadata.

Required Fields

NameTypeDescription
idStringThe given identifier of this Manga. This may be unique to the source which uses it. For example, one source may use the value '1234' to identify a manga, whereas another one may use the value 'One-Piece' to identify
imageStringA URL pointing to a thumbnail which can be displayed to present the manga.
titleIconTextAn Icon Text object representing the title of the manga.

Optional Fields

NameTypeDescription
subtitleTextIconTextAn Icon Text object representing the subtitle of the manga.
primaryTextIconTextAn Icon Text which can be shown as primary text to the thumbnail. This is rendered in the bottom left of the manga object on the view.
secondaryTextIconTextAn Icon Text which can be shown as secondary text to the thumbnail. This is rendered on the bottom right of the manga object on the view.

PagedResults

An object representing a "page" of requests. There is no limit to how many mangas fit in a page, that is up to the source to decide. These objects use the metadata field.

Required Fields

NameTypeDescription
resultsMangaTile ArrayThe mangas that were found in the page.
metadataanyThe metadata to carry onto future calls of the function returning the object. Reference the page on metadata to learn more.

SearchRequest

An object representing the various properties in a search. The title parameter is the only parameter that is supported by the search request, and future versions of the API plan on changing the way advanced searches are done.

Optional Fields

NameTypeDescription
titleStringThe text that the user is searching in the search box. Note: The title may be empty, such as if the user deletes the entire query. While some sources just treat an empty search as a queue to return all chapters, other sources might reject empty searches. Make sure to adequately deal with empty searches.
authorStringThe author that the user is searching works by.
artistStringThe artist that the user is searching works by.
statusMangaStatusThe status of the manga.
hStatusBooleanWhether or not to return only explicit results or to exclude all explicit results.
includeDemographicString ArrayThe demographics to include in the search.
includeThemeString ArrayThe themes to include in the search.
includeFormatString ArrayThe formats to include in the search.
includeContentString ArrayThe content to include in the search.
includeGenreString ArrayThe genres to include in the search.
includeOperatorString ArrayThe operators to include in the search.
excludeDemographicString ArrayThe demographics to exclude in the search.
excludeThemeString ArrayThe themes to exclude in the search.
excludeFormatString ArrayThe formats to exclude in the search.
excludeContentString ArrayThe content to exclude in the search.
excludeGenreString ArrayThe genres to exclude in the search.
excludeOperatorString ArrayThe operators to exclude in the search.

Tag

A model representing an individual tag.

Required Fields

NameTypeDescription
idStringThe internal identifier for the tag. Usually either the tag's name or a number that represents the tag.
labelStringThe text for the tag that is shown to the user.

TagSection

A model representing a section of tags. Most sources have a section for official genres, and some sources might have a section of user-defined tags in addition to the official genres. Currently, only one tag section is displayed in a manga, although this might change in the future.

Required Fields

NameTypeDescription
idStringThe ID representing this tag section.
labelStringThe name of the Tag Section. The name is not currently shown to the user, but this may change in future versions of Paperback.
tagsTag ArrayAn array of tags.