Skip to content

Interface SearchOptions

The search options of the search API.

🏷️ Properties

categoryId optional

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 optional

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 optional

ts
gameId: number

The game id. The Minecraft is 432.

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

gameVersion optional

ts
gameVersion: string

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

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

gameVersionTypeId optional

ts
gameVersionTypeId: number

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

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

index optional

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 optional

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 optional

ts
modLoaderTypes: string[]

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

pageSize optional

ts
pageSize: number

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

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

searchFilter optional

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 optional

ts
slug: string

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

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

sortField optional

ts
sortField: ModsSearchSortField

Filter by ModsSearchSortField enumeration

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

sortOrder optional

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