-
Notifications
You must be signed in to change notification settings - Fork 0
NEM API Documentation
Welcome to the NEM-API documentation and wiki page!
NotEnoughMods is a metadata service that provides vital data on your favorite minecraft mods.. Its main goal is to provide a central place to gather and contribute data about a mod. Another goal is the ability to de-centralize the mod hosting experience, allow modders to host from wherever they like.
Table of Contents:
The API will always return an object based on its name like shown:
GET - /mod
{ "mod": .... }
Some example error responses are shown below:
Validation error when adding a mod
"id": "unprocessable_request",
"message": "The name field is required",
Mod not found
"id": "not_found",
"message": "Mod not found"
The Header used to authentication via token is X-NEM-Token
Example:
curl -H "X-NEM-Token: 74Fse3zFbzzZH2M8ig0e"
The API has a rate limit in place to prevent abuse and maintain the stability of the API. These rate limits are set to 5 requests per minutes for unauthenticated users. Authenticated users are limited to 60 requests per minute.
The limits are presented to you via headers in the response as the following:
-
X-RateLimit-Limit
- This describes the limit placed on you. -
X-RateLimit-Remaining
- This describes how many requests you have left before your limited -
X-RateLimit-Reset
- This represents the time when the oldest request will expire. The value is given in Unix epoch time.
As long as the RateLimit-Remaining
count is above zero, you will be able to make additional requests.
If the RateLimit-Remaining reaches zero, subsequent requests will receive a 429 error code until the request reset has been reached. You can see the format of the response in the examples.
http://genpage.xyz/mcversion/{version}
Parameters:
- version: string - The minecraft version you are looking for
Example:
curl -H "X-NEM-Token: 74Fse3zFbzzZH2M8ig0e" genpage.xyz/mversion/1.7.10
http://genpage.xyz/mod/{modid}
Parameters:
- modid: string - The modid of the mod you are looking for
Example:
curl genpage.xyz/mod/foobar
Parameters:
- name: string - Required - The name of the mod
- modid: string - Required - The modid of the mod
- longurl: url - Required - The link to the mods homepage
- shorturl: url - Deprecated
- license: string
- repo: url - Link to the mods codebase
- description: string
Example:
curl -H "X-NEM-Token: 74Fse3zFbzzZH2M8ig0e" --data "name=FooBar&modid=foobar&url=https://github.com" genpage.xyz/mod
You must be an admin to do this.
Parameters:
- modid: string - The modid of the mod you are looking to delete
Example:
curl -X DELETE -H "X-NEM-Token: 74Fse3zFbzzZH2M8ig0e" genpage.xyz/mod/foorbar
Parameters:
- modid: string - The modid of the mod you are looking to attach an author to
- slug: string - The slug of the author you want to link to the Mod
Example:
curl -X PUT -H "X-NEM-Token: 74Fse3zFbzzZH2M8ig0e" --data="slug=genpage" genpage.xyz/mod/foobar/author
Parameters:
- slug: string - The slug of the author
Example:
curl -H "X-NEM-Token: 74Fse3zFbzzZH2M8ig0e" genpage.xyz/author/genpage
Parameters:
- name: string - The name of the author you want to create
Example:
curl -X POST -H "X-NEM-Token: 74Fse3zFbzzZH2M8ig0e" --data="name=genpage" genpage.xyz/author
You must be an admin to do this.
Parameters:
- slug: string - The slug of the author you want to delete
Example:
curl -X DELETE -H "X-NEM-Token: 74Fse3zFbzzZH2M8ig0e" genpage.xyz/author/genpage