Skip to content

Interface SearchOptions

The search options of the search API.

🏷️ Properties

categoryId

ts
categoryId: number

This is actually the sub category id of the sectionId. All the numbers for this should also be fetch by getCategories.

To get available values, you can:

ts
const cat = await getCategories();
const sectionId = 6; // the mods
const categoryIds = cat
 .filter(c => c.gameId === 432) // 432 is minecraft game id
 .filter(c => c.rootGameCategoryId === sectionId) // only under the section id
 .map(c => c.id);
// Use categoryIds' id to search under the corresponding section id.

Defined in: packages/curseforge/index.ts:399

classId

ts
classId: number

The category section id, which is also a category id. You can fetch if from getCategories.

To get available categories, you can:

ts
const cat = await getCategories();
const sectionIds = cat
 .filter(c => c.gameId === 432) // 432 is minecraft game id
 .filter(c => c.rootGameCategoryId === null).map(c => c.id);
// the sectionIds is all normal sections here

Defined in: packages/curseforge/index.ts:381

gameId

ts
gameId: number

The game id. The Minecraft is 432.

Defined in: packages/curseforge/index.ts:405

gameVersion

ts
gameVersion: string

The game version. For Minecraft, it should looks like 1.12.2.

Defined in: packages/curseforge/index.ts:409

gameVersionTypeId

ts
gameVersionTypeId: number

Filter only mods that contain files tagged with versions of the given gameVersionTypeId

Defined in: packages/curseforge/index.ts:435

index

ts
index: number

The index of the addon, NOT the page!

When your page size is 25, if you want to get next page contents, you should have index = 25 to get 2nd page content.

Defined in: packages/curseforge/index.ts:417

modLoaderType

ts
modLoaderType: FileModLoaderType

Filter only mods associated to a given modloader (Forge, Fabric ...). Must be coupled with gameVersion.

Defined in: packages/curseforge/index.ts:429

modLoaderTypes

ts
modLoaderTypes: string[]

Defined in: packages/curseforge/index.ts:431

pageSize

ts
pageSize: number

The page size, or the number of the addons in a page.

Defined in: packages/curseforge/index.ts:445

searchFilter

ts
searchFilter: string

The keyword of search. If this is absent, it just list out the available addons by sectionId and categoryId.

Defined in: packages/curseforge/index.ts:449

slug

ts
slug: string

Filter by slug (coupled with classId will result in a unique result).

Defined in: packages/curseforge/index.ts:439

sortField

ts
sortField: ModsSearchSortField

Filter by ModsSearchSortField enumeration

Defined in: packages/curseforge/index.ts:421

sortOrder

ts
sortOrder: "desc" | "asc"

'asc' if sort is in ascending order, 'desc' if sort is in descending order

Defined in: packages/curseforge/index.ts:425

Released under the MIT License.