about summary refs log tree commit diff
path: root/README.md
blob: 677c2a9952bf681667c7ba4d0be04af681b1bf53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
[![GoDoc](https://godoc.org/git.darknebu.la/Satellite/tle2json?status.svg)](https://godoc.org/git.darknebu.la/Satellite/tle2json) [![Go Report Card](https://goreportcard.com/badge/git.darknebu.la/Satellite/tle2json)](https://goreportcard.com/report/git.darknebu.la/Satellite/tle2json)
[![Build Status](https://drone.nbg1.emile.space/api/badges/Satellite/tle2json/status.svg)](https://drone.nbg1.emile.space/Satellite/tle2json)
# TLE2JSON

http api returning TLEs as json

## Setup

### Run the server

standalone:
`go run . -p <port>`

docker:
```
$ docker build . -t tle2json
$ docker run -p <port extern>:8080 tle2json
```

### Populate the cache

By accessing the `/dumpall` endpoint, you can download all the TLEs populating
the cache. The next time the file containing the TLE needs to be accessed, it
doesn't need to be downloaded resulting in somwhat faster results.

![](imgs/out.png)

## API

### endpoints

The api will eventually consist of the following endpoints. There is currently
no guarantee that the enpoins will stay like this, this is really early alpha
and may change alot in the next days / weeks:

- `/v1/getall`
    - returns all TLEs
- `/v1/regex/{regex}`
    - returns all the TLEs matching the given `regex`
- `/v1/satid/{satid}`
    - returns all the TLEs with the given `satid`
- `/v1/category/{category}`
    - returns all the TLEs from the named category
    - (the categories are the ones given [here](https://celestrak.com/NORAD/elements/))
- `/v1/category/{category}/satname/{satname}`
    - returns the TLE of the satellite in the given `category` with the given
        `satname`

### parameters

- `?format=json`
    - returns the TLEs as json objects
- `?format=raw`
    - returns the TLE in the raw Two-Line format
- `?values=inclination,argumentofperigee`
    - returns the values given as a comma, seperated list of arguments