Skip to content

moddex-js ​

Classes ​

ClassDescription
CatalogApiAPI namespace for the catalog vocabulary: every value the projects.list filters take. ModDex caches it for an hour.
LookupApiAPI namespace for finding ModDex projects from ModDex, CurseForge or Modrinth IDs, slugs, links or files. Lookup resolves every project with a page on ModDex, including delisted ones (available: false).
ModDexAmbiguousErrorThrown on 422 with code ambiguous: a slug belongs to a mod and a modpack. Pass type to pick one.
ModDexAuthenticationErrorThrown on 401 Unauthorized: the token is invalid (unauthenticated) or expired (token_expired).
ModDexClientClient for the ModDex API v2. Every endpoint is public, so a token is optional.
ModDexClientCoreLow-level HTTP client used internally by all API namespace classes.
ModDexConflictErrorThrown on 409 Conflict when the identifiers of an explicit lookup match different projects.
ModDexErrorBase class for every error thrown by the client. Catch this to handle all failures at once.
ModDexForbiddenErrorThrown on 403 Forbidden: the client is blocked, or the token can't be used.
ModDexNetworkErrorThrown when the request failed before a response was received, e.g. DNS, connection or CORS failures.
ModDexNotFoundErrorThrown on 404 Not Found: no such project, review or route. A lookup that finds nothing throws this too.
ModDexRateLimitErrorThrown on 429 Too Many Requests. Wait retryAfter seconds before retrying.
ModDexServiceUnavailableErrorThrown on 503 Service Unavailable: the API is busy, timed out, or down for maintenance, or search is unavailable. Expensive requests can get this whatever your own rate limit. Wait retryAfter seconds before retrying.
ModDexTimeoutErrorThrown when the request did not complete within timeoutMs.
ModDexValidationErrorThrown on 422 Unprocessable Content: a parameter is invalid (validation_failed), the page is too deep (page_depth_exceeded), or a sync cursor was edited (invalid_cursor).
ProjectsApiAPI namespace for projects, addressed by ModDex project ID. Use client.lookup to get the ID from a CurseForge or Modrinth ID, slug or link.
ReviewsApiAPI namespace for reviews across every project.
SyncApiAPI namespace for the cursor feeds, for keeping a copy of ModDex data in sync. ModDex's terms require removing content within 7 days of its removal from ModDex: delete tombstoned projects with their reviews, and at least daily delete every stored review that listReviewIds doesn't list.
UserApiAPI namespace for the user that owns the API token.

Interfaces ​

InterfaceDescription
AmbiguousLookupA batch value that could mean a mod or a modpack, sent without type.
AuthenticatedUserThe user that owns the API token, as returned by GET /api/user.
BatchLookupOptionsQuery parameters for lookup.batch. Up to 100 values in total.
BatchLookupResultResult of lookup.batch, keyed by each value as sent (trimmed).
CacheOptionsIn-memory response cache settings.
CatalogFiltersEvery projects.list parameter and sort, as returned by catalog.getFilters.
CatalogParameterOne projects.list parameter.
CommunityTagA tag in a project's community tag panel.
CommunityTagsA project's community tags, as returned by projects.getCommunityTags.
CurseForgeListingA project's CurseForge listing, in the full shape.
DependencyA dependency as the project's listing declares it.
DependencyListMetaExtra meta fields of projects.listDependencies and projects.listContents.
DependencyListResponseResponse of projects.listDependencies and projects.listContents.
DependentA project that depends on another.
DependentListMetaExtra meta fields of projects.listDependents.
DeveloperResponseA project developer's public reply to a review.
ExplicitLookupMatchHow one parameter of an explicit lookup matched.
ExplicitLookupOptionsQuery parameters for lookup.find. Pass any combination of the six keys and url. Each is resolved on its own: the response is a 200 when all hits are the same project, even if some keys miss, and a 409 conflict when keys hit different projects.
ExplicitLookupResponseResponse of lookup.find.
FeaturedInfoA staff pick.
FileBatchLookupOptionsQuery parameters for lookup.fileBatch. Up to 100 values in total.
FileBatchLookupResultResult of lookup.fileBatch, keyed by each value as sent. null when unknown, hidden or malformed.
FileListMetaExtra meta fields of projects.listFiles.
FileMatchA file mapped to its project.
GetProjectOptionsQuery parameters for projects.get.
LatestReleaseThe newest release on one platform.
ListDependenciesOptionsQuery parameters for projects.listDependencies and projects.listContents.
ListDependentsOptionsQuery parameters for projects.listDependents.
ListFilesOptionsQuery parameters for projects.listFiles.
ListMinecraftVersionsOptionsQuery parameters for catalog.listMinecraftVersions.
ListProjectsOptionsQuery parameters for projects.list. catalog.getFilters() lists every parameter and its valid values. A search (q) or any filter counts against a separate, lower rate limit.
ListReviewsOptionsQuery parameters for reviews.list.
ListSimilarProjectsOptionsQuery parameters for projects.listSimilar.
ListTagsOptionsQuery parameters for catalog.listTags.
LookupMatchHow a lookup value matched its project.
LookupOptionsQuery parameters for lookup.get.
LookupResponseResponse of lookup.get.
LookupReviewsMetaExtra meta fields of lookup.listReviews.
LookupReviewsOptionsQuery parameters for lookup.listReviews.
MaskingOptionsQuery parameter for endpoints that return review text.
MinecraftVersionA Minecraft version the catalog knows.
ModDexClientOptionsOptions for creating a ModDexClient.
ModDexErrorBodyError body returned by the ModDex API.
ModDexErrorOptionsOptions accepted by ModDexError and its subclasses.
ModDexPaginatedResponseEnvelope returned by paginated ModDex endpoints. M adds endpoint-specific fields to meta.
ModDexResponseEnvelope returned by non-paginated ModDex endpoints.
ModrinthListingA project's Modrinth listing, in the full shape.
ModrinthOrganizationThe Modrinth organization that owns a project.
PaginateOptionsOptions for paginate, followCursor and the iterate* helpers.
PaginationLinksLinks to neighbouring pages included in paginated responses.
PaginationMetaPagination metadata included in paginated responses.
PaginationOptionsCommon query parameters for paginated endpoints. page × per_page may not exceed 10,000.
PlatformListingSummaryA listing of a project on CurseForge or Modrinth, in the list shape.
ProjectFull details of a project, as returned by projects.get and the lookups.
ProjectAuthorA credit on a project page.
ProjectCountsItem counts of a project.
ProjectFileOne release. A CurseForge row is a file with its server pack attached. A Modrinth row is a version: its primary file's fields at the top level and its other files in secondary_files.
ProjectLicenseA project's license.
ProjectLinksLinks to a project on ModDex.
ProjectListItemA project in the list shape, as returned by projects.list and other project lists.
ProjectPlatformUrlsExternal links of a project. Each is an https URL or null.
ProjectRatingAggregate rating of a project.
ProjectRatingsRating histograms and ranks, added with include: ['ratings'].
ProjectSourceA listing a project is downloaded from, including merged loader-specific listings.
ProjectSummaryThe smallest project shape, used in lookups, batch lookups, reviews and error candidates.
RateLimitRate limit state reported by the X-RateLimit-* response headers.
RatingStepHow many ratings landed on one star step.
ReputationReputation of a ModDex user.
RequestOptionsOptions passed to individual request methods.
RetryableErrorOptionsOptions accepted by the errors that carry a Retry-After.
ReviewAn approved review or quick rating.
ReviewAuthorA ModDex user who wrote a review or a developer response.
ReviewCategoriesCategory ratings of a review. Each is 0.5 to 5, or null when not rated.
ReviewFilterOptionsFilters shared by every review list.
ReviewImageAn image attached to a review.
ScreenshotA screenshot from a platform listing.
SecondaryFileAnother file of a Modrinth version.
ServerPackA CurseForge modpack's server pack.
SimilarProjectsResponseResponse of projects.listSimilar.
SyncOptionsWhere a sync feed starts. Pass cursor to continue, or since (or neither) to start over.
SyncProjectsOptionsQuery parameters for sync.listProjects.
SyncResponseEnvelope of the cursor-paged sync feeds. The feeds only go forward.
SyncReviewsOptionsQuery parameters for sync.listReviews.
TagA taxonomy tag.
TaxonomyTermA taxonomy value. The slug is what the matching projects.list filter takes.
TokenExpiryToken expiry reported by the X-ModDex-Token-Expires response header.
UserSocialLinksSocial profile links of the authenticated user.

Type Aliases ​

Type AliasDescription
BatchLookupEntryOne batch lookup value: its project, ambiguous candidates, or null when not on ModDex or not valid.
CatalogParameterTypeValue types of projects.list parameters. boolean takes 1/0/true/false, date takes ISO 8601.
FileLookupOptionsQuery parameters for lookup.file. Pass exactly one of sha1 or curseforge_file_id.
FileSortFieldSort fields accepted by projects.listFiles.
FilterModeHow a list filter combines its values.
LicenseCategoryLicense categories.
ListProjectReviewsOptionsQuery parameters for projects.listReviews. Quick ratings count toward the rating but aren't listed.
LookupKeyAn identifier a lookup can match on.
LookupPlatformA platform a lookup value can come from.
LookupReviewsResponseResponse of lookup.listReviews.
ModDexErrorCodeStable machine-readable error code sent in the code field of every v2 error.
PackSizeModpack sizes by mod count.
PlatformA platform ModDex lists projects from.
PlayStatusHow far a reviewer got with a project.
ProjectIncludeHeavy blocks a project response leaves out unless asked for.
ProjectSortFieldSort fields accepted by projects.list.
ProjectSyncRowA row of the projects sync feed: a live project in the list shape, or a tombstone. Tell them apart by removed.
ProjectTombstoneA project that no longer resolves. Delete it and its reviews if you store them.
ProjectTypeKind of project.
QueryValueA value that can be serialized as a URL query parameter. Booleans are sent as 1 / 0. Arrays are sent as a comma-separated list, each item encoded on its own.
RelationSortFieldSort fields accepted by the dependency and dependent lists.
RelationTypeHow one project depends on another.
ReleaseTypeRelease channel of a file.
ReviewMediaFilterWhich reviews to keep by attached media.
ReviewSortSort orders accepted by the review lists.
SideSupportHow a project installs, as Modrinth used to report it. Deprecated by Modrinth.
SortDirectionSort direction accepted by list endpoints.
TagTypeTag categories. Loaders and Minecraft versions have their own lists.
UserRoleStaff badges a profile can show.

Functions ​

FunctionDescription
followCursorFollows a sync feed's cursor, yielding each page until the feed has no more rows ready. Pages are yielded whole, so the last one's meta.next_cursor can be stored and passed back later to poll for new changes.
paginateIterates every item of a paginated endpoint, fetching one page at a time as the loop advances.

References ​

default ​

Renames and re-exports ModDexClient