|
| 1 | +# APOD cache server & API |
| 2 | + |
| 3 | + |
| 4 | + |
1 | 5 | **A dead simple API that scrap, cache and serve APOD (Astronomy Picture of the Day) info from [nasa](https://apod.nasa.gov/apod/) / [star.ucl](http://www.star.ucl.ac.uk/~apod/apod/)!** |
2 | 6 |
|
3 | | -Inspired from: [@apod@reentry.codl.fr](https://reentry.codl.fr/@apod) |
| 7 | +**Inspired from** the activitypub bot, [@apod@reentry.codl.fr](https://reentry.codl.fr/@apod) |
| 8 | + |
| 9 | +### API Endpoints |
4 | 10 |
|
5 | | -Usage: |
| 11 | +- GET `/api/v1/apod.json` |
| 12 | + |
| 13 | +### Usage |
6 | 14 | ```sh |
7 | | -curl http://127.0.0.1:8000/api/v1/apod/ | jq |
| 15 | +curl http://localhost:8000/api/v1/apod.json -s | jq |
8 | 16 | { |
9 | | - "img": "<http url>", |
10 | | - "description": "", |
11 | | - "title": "", |
12 | | - "date": "YYYY-MM-DD", |
| 17 | + "credits": "www.star.ucl.ac.uk", |
| 18 | + "img": "http://localhost:8000/api/v1/apod-img.jpg", |
| 19 | + "description": "Put on your red/blue glasses and float next to asteroid 101955 Bennu. Shaped like a spinning toy top with boulders littering its rough surface, the tiny Solar System world is about one Empire State Building (less than 500 metres) across. Frames used to construct this 3D anaglyph were taken by PolyCam on the OSIRIS_REx spacecraft on December 3, 2018 from a distance of about 80 kilometres. With a sample from the asteroid's rocky surface on board, OSIRIS_REx departed Bennu's vicinity in May of 2021. The robotic spacecraft successfully returned the sample to its home world in September of 2023.", |
| 20 | + "title": "3D Bennu", |
| 21 | + "source": "http://www.star.ucl.ac.uk/~apod/apod/", |
| 22 | + "date": "2025-10-19" |
13 | 23 | } |
14 | 24 | ``` |
15 | 25 |
|
| 26 | +### Env Vars: |
| 27 | +- `APOD_PAGE_URL` (defaults to `http://www.star.ucl.ac.uk/~apod/apod/`, compatable with `https://apod.nasa.gov/apod/` (but the site is dead today)) |
| 28 | +- `SERVICE_BASE_URL` (defaults to empty string, eg: `http://localhost:8000` ) |
| 29 | +- `APOD_PAGE_MAX_SIZE` (defaults to 50kb) -- to save your server |
| 30 | +- `APOD_IMG_MAX_SIZE` (defaults to 10Mb) -- to save your server |
16 | 31 |
|
17 | | -Env Vars: |
18 | | -- `APOD_SITE_URL` (defaults: `http://www.star.ucl.ac.uk/~apod/apod/`, compatable with `https://apod.nasa.gov/apod/` (but the site is dead today)) |
19 | | - |
20 | | -dockers: |
21 | | - - bruttazz/apod-api |
| 32 | +### Pre-built docker images: |
| 33 | +- `bruttazz/apod-api` |
22 | 34 |
|
23 | | -live-apis: |
24 | | - - apod.brutt.site/api/v1/apod |
| 35 | +### Live Endpoints |
| 36 | +- (https://apod.brutt.site/api/v1/apod.json)[https://apod.brutt.site/api/v1/apod.json] |
25 | 37 |
|
| 38 | +### Credits |
26 | 39 | All rights reserved to respective sites: [star.ucl](http://www.star.ucl.ac.uk/~apod/apod/) / [nasa](https://apod.nasa.gov/apod/) |
0 commit comments