# easy-roblox-api

> This package is an extremely easy package, to easily get data from the Roblox API.

Latest version **2.0.1** (published 2021-03-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install easy-roblox-api
pnpm add easy-roblox-api
yarn add easy-roblox-api
bun add easy-roblox-api
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2021-03-11 |
| First published | 2021-03-10 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Yankue |
| Maintainers | yankue |
| Keywords | roblox, easy, api, object orientated, rbx |

## Links

- npm: https://www.npmjs.com/package/easy-roblox-api
- Repository: https://github.com/Yankue/easy-roblox-api
- Homepage: https://github.com/Yankue/easy-roblox-api#readme
- Issues: https://github.com/Yankue/easy-roblox-api/issues
- npm.io page: https://npm.io/package/easy-roblox-api

## Dependencies (1)

- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.1

## Recent versions

- 2.0.1 (latest) — 2021-03-11
- 2.0.0 — 2021-03-11
- 1.1.0 — 2021-03-10
- 1.0.0 — 2021-03-10

## README

# easy-roblox-api
This package is an extremely easy package, to easily get data 
from the Roblox API.
## Installation
Install with NPM:
```
$ npm install easy-roblox-api
```
### Version
The current version is v2.0.0 - which added the `getGroup()` function. This is the most stable and recommended version.

## Quick Start
### Information about a User
This will get a lot of data about user:
```js
const roblox = require('easy-roblox-api');
roblox.getUser("Some rbx username", "username").then(response => {
   console.log(response); 
}).catch(() => {
  console.log("An error occured, most likely that user does't exist!");
});

/* This will log something like this:
{
  id: 1,
  username: 'John Doe',
  description: 'The users description here',
  status: 'The users status here',
  created: '2016-07-04T16:59:11.313Z',
  avatar_url: 'URL to an image of the user's avatar',
  friends: {
    count: 8,
    ids: [array-of-friends-ids]
  },
  followers: {
    count: 14,
    ids: [array-of-followers-ids]
  },
  following: {
    count: 69,
    ids: [array-of-followings-ids]
  }
}*/
```
As an alternative, you can get user information using an ID:
```js
const roblox = require('easy-roblox-api');
roblox.getUser("140445252", "id").then(response => {
   console.log(response); 
});
```
If you leave the 2nd parameter of `getUser` empty, it will assume it is an ID.

### Information about a Group

```js
roblox.getGroup("some group", "name").then(res => {
    console.log(res);
}).catch(console.error);

/* This will log something like this:
{
  id: 1,
  name: 'Example name',
  description: 'Example group description',
  owner: { id: 4, username: 'John Doe' },
  membercount: undefined,
  thumbnail: 'some-url-to-a-png',
  shout: {
    content: 'omghi',
    created: '2021-03-11T19:09:57.3352677Z',
    author: { id: 4, username: 'John Doe' }
  },
  roles: [
    { id: 7, name: 'Some role name', membercount: 0 },
    { id: 69, name: 'Some other role name', membercount: 6 }
  ]
}
*/
```
Just like when getting user data, you can put `id` instead of `name` as parameter 2 when getting group data. ID is the default if none is provided.


## Support
To get support using the package, report bugs, request updates, or any other sort of request, please use our [GitHub issues page](https://github.com/Yankue/easy-roblox-api/issues), where I will gladly help you.

## Documentation
Documentation will be on the wiki on GitHub, but this is coming soon.

---
_Source: https://npm.io/package/easy-roblox-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
