# rae-api

> This API allows you to search a word and their definitions on the Real Academia Española

Latest version **1.5.3** (published 2023-06-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install rae-api
pnpm add rae-api
yarn add rae-api
bun add rae-api
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.5.3 |
| Published | 2023-06-11 |
| First published | 2020-10-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 21.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 26 |
| Author | account0123 |
| Maintainers | account0123 |
| Keywords | rae, words, search, definitions, spanish, real, academia |

## Links

- npm: https://www.npmjs.com/package/rae-api
- Repository: https://github.com/account0123/RAE-API
- Homepage: https://github.com/account0123/RAE-API#readme
- Issues: https://github.com/account0123/RAE-API/issues
- npm.io page: https://npm.io/package/rae-api

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.5.3 (latest) — 2023-06-11
- 1.2.5 (stable) — 2021-10-24
- 1.5.2 — 2023-04-09
- 1.5.1 — 2022-11-16
- 1.5.0 — 2022-02-28
- 1.2.4-a — 2021-10-24
- 1.2.4 — 2021-06-24
- 1.2.3 — 2021-06-19
- 1.2.2 — 2020-12-29
- 1.2.1 — 2020-10-16
- 1.2.0 — 2020-10-13
- 1.1.0 — 2020-10-13
- 1.0.5 — 2020-10-12
- 1.0.4 — 2020-10-12
- 1.0.3 — 2020-10-12
- … 3 more at https://npm.io/package/rae-api/versions

## README

# RAE-API

RAE API i modified from <https://github.com/mgp25/RAE-API> to nodejs

See examples folder for more information.

## Installation

```bash
npm install rae-api
```

## Usage

Importing rae class

```js
const { RAE } = require('rae-api');

const rae = new RAE();
```

Enabling debug mode

```js
const rae = new RAE(true); // prints https request
```

Getting Word Of The Day

```js
const wotd = await new RAE().getWordOfTheDay();

const word = wotd.getHeader();
console.log(`La palabra del día es: ${word}\n`);
```

Getting the definitions from a word search

```js
const rae = new RAE();
const search = await rae.searchWord('hola');
const wordId = search.getRes()[0].getId(); // gets 'hola' word id

const result = await rae.fetchWord(wordId); // fetches the word as object
const definitions = result.getDefinitions(); // gets all 'hola' definitions as Defintion[]
const first = definitions[0].getDefinition(); // gets the first 'hola' definition as string
```

Getting the definitions from a random word
```js
const random = await new RAE().getRandomWord(); //fetches a random word
const definitions = random.getDefinitions(); // gets all definitions of random word as Definition[]
const first = definitions[0].getDefinition(); // gets the first definition of random word as string
```

## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License

[MIT](https://choosealicense.com/licenses/mit/)

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