Skip to content

Commit

Permalink
docs: random query is now documented
Browse files Browse the repository at this point in the history
  • Loading branch information
dag7dev committed May 17, 2024
1 parent c50cd7c commit 7455da2
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ Returns every entry in the database. Every entry is represented by its game mani
Return every entry in the database matching the given conditions. Every entry is represented by its game manifest.

The following query parameters can be used:

- `type` (exact matching)
- `developer` (exact matching)
- `platform` (exact matching)
- `tags` (exact matching, comma-separated array e.g. `/search?tags=Open Source,RPG`)
- `title` ("contains" matching, e.g. `/search?title=brick` will return "**Brick**ster" and "**Brick**Breaker")
- `random` (if true, the results will be in a random order)

More than one query parameter can be specified. They will be concatenated in "AND" statements, i.e. `/search?type=homebrew&platform=GBC` will return every Homebrew developed with GBC features.

Expand All @@ -94,26 +94,9 @@ Every matching is case-insensitive.
curl hh3.gbdev.io/api/search?tags=Open Source,RPG&platform=GBC
```

### GET `/random`

Return a random entry.

The following query parameters can be used:

- `type` (exact matching)
- `developer` (exact matching)
- `platform` (exact matching)
- `tags` (exact matching, comma-separated array e.g. `/search?tags=Open Source,RPG`)

More than one query parameter can be specified. They will be concatenated in "AND" statements, i.e. `/random?type=homebrew&platform=GBC` will return every Homebrew developed with GBC features.

Every matching is case-insensitive.

#### Examples

```bash
# Get every RPG released as Open Source with Game Boy Color features:
curl hh3.gbdev.io/api/random?tags=Open Source,RPG&platform=GBC
# Get random Game Boy Color games:
curl hh3.gbdev.io/api/search?random=true&platform=GBC
```

### Pagination
Expand Down

0 comments on commit 7455da2

Please sign in to comment.