An open API service indexing awesome lists of open source software.

https://github.com/mitsunee/fgo-api-playground

This repository is my personal playground for doing stuff with the Fate/Grand Order API provided by Atlas Academy
https://github.com/mitsunee/fgo-api-playground

api fate-grand-order fgo playground

Last synced: 3 months ago
JSON representation

This repository is my personal playground for doing stuff with the Fate/Grand Order API provided by Atlas Academy

Awesome Lists containing this project

README

        

# fgo-api-playground

This repository is my personal playground for doing stuff with the [FGO Game Data API](https://api.atlasacademy.io/docs) provided by [Atlas Academy](https://atlasacademy.io/)

Fate/Grand Order

## Usage

This repository is inded to be used with Node.js v22 and pnpm 9.x

```
pnpm install
pnpm prepare-cache
```

## Scripts

### Servant Search

```
pnpm search-servant [-c,--collection] [-t,--threshold] ...queries
```

Script to easily search for Servants by name.

- `-t`/`--threshold`: fuzzy search threshold (number from 0 to 1)
- `-c`/`--collection`: display collection number instead of id
- `--no-original`: hide the original name for search results of alternative names
- `--no-alt`: do not consider alternative names in searches

### Future Welfare Servant Search

```
pnpm tsx src/welfares/script.ts
```

Script that lists event welfare Servants that have not yet been released on the EN server.

### AP Calc

```
pnpm ap-calc [-m,--max ] [-n,--node ] [-t,--target ] []
```

Simple AP Calculator that calculates time to Max AP and targets based on node cost or target AP. Output is given as a table with time (24h notation) and delta until that point.

- `-m`,`--max`: Override for Max AP (Default: `144`)
- `-n`,`--node`: Node Cost (shows all possible future runs; optional)
- `-t`,`--target`: Sets target AP (optional)
- Positional: Values for current ap (num; required) and time until next AP (either as `M:SS` or `MSS`; optional)

## Cache

Instead of constantly redownloading the same data the `pnpm prepare-cache` script downloads all needed data for servants and items at once and stores it in `./data/cache`. Data is transformed to match the data structures descriped in [`./src/types`](./src/types), which avoids duplicates and removes attributes that are not used in any scripts.

```
data
├── freeQuestList.json (transformed free quest data)
├── itemsList.json (transformed item data)
├── servantsList.json (transformed servant data)
├── skillsList.json (transformed skill data)
├── warsList.json (transformed war data)
└── cache
├── info.json (information cache export age and last check date)
├── EN
| ├── nice_servant.json (niceServant (with lore) export)
| ├── nice_war.json (niceWar export)
| └── questPhase
| └── {id}_{phase}.json (basic quest phase cache)
└── JP
├── nice_servant.json (niceServant (with lore) export)
├── nice_war.json (niceWar export)
└── questPhase
└── {id}_{phase}.json (basic quest phase cache)
```

Data should always be retrieved with the provided utilities in [`./src/cache`](./src/cache/index.ts)

### Flags

`prepare-cache` takes the following flags:

- `--verbose`, `-v`: Show debug output
- `--force-check`, `-f`: Force checking API for updated exports
- `--reprocess`, `-r`: Don't check API and reprocess cached exports (disables `-f`!)