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

https://github.com/shitpostingio/analysis-api


https://github.com/shitpostingio/analysis-api

Last synced: 5 months ago
JSON representation

Awesome Lists containing this project

README

          

# Analysis API

REST-powered API for analyzing media and text.

## Endpoints

- Media analysis `/analysis/{reqType}/{type}/{id}`
- Text analysis `/analysis/{reqType}`
- Health check `/healthy`

## Request types

- Complete media analysis: `complete`
- Media fingerprinting: `fingerprinting`
- Media NSFW recognition: `nsfw`
- Gibberish text analysis: `gibberish`

## Returned data

The data returned by the server when analyzing media is in the form:

```go
type Analysis struct {
Fingerprint FingerprintResponse
NSFW NSFWResponse
FingerprintErrorString string
NSFWErrorString string
}

```

The data returned by the server when analyzing text is in the form:

```go
type GibberishResponse struct {
IsGibberish bool
}
```

## Environment options

- API bind address and port: `API_BIND_ADDRESS` (defaults to `localhost:9999`).
- Path to configuration file: `API_CFG_PATH` (defaults to `config.toml`).

## Configuration file structure

```toml
fingerprintendpoint = "http://localhost:10000/fingerprinting"
nsfwendpoint = "http://localhost:10001/nsfw"
gibberishendpoint = "http://localhost:10002/gibberish"
testing =

[database]
authsource = "authsource"
collectionname = "collectionname"
databasename = "databasename"
hosts = ["localhost:27017"]
password = "password"
replicasetname = "replicasetname"
username = "username"

[redis]
Address = "localhost:6379"
NSFWDatabase = 2
FingerprintDatabase = 1
```