MENU navbar-image

Introduction

This documentation aims to provide all the information you need to work with our API.

Base URL

https://astolfo.rocks

Authenticating requests

This API is not authenticated.

Home

GET api/v1/health_check

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://astolfo.rocks/api/v1/health_check',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
access-control-allow-origin: *
 

[]
 

Request      

GET api/v1/health_check

GET api/v1/version

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://astolfo.rocks/api/v1/version',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 58
access-control-allow-origin: *
 

{}
 

Request      

GET api/v1/version

GET api/v1/stats

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://astolfo.rocks/api/v1/stats',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 57
access-control-allow-origin: *
 

{
    "images": {
        "total": 2117,
        "": 0
    },
    "tags": {
        "total": 711
    }
}
 

Request      

GET api/v1/stats

Image

GET api/v1/images/random/{rating?}

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://astolfo.rocks/api/v1/images/random/safe',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "id": 4246,
    "rating": "safe",
    "created_at": "2021-12-06T08:30:38.000000Z",
    "updated_at": "2021-12-06T08:30:38.000000Z",
    "views": 0,
    "source": "https://www.pixiv.net/en/artworks/86487950",
    "file_extension": "jpeg",
    "mimetype": "image/jpeg",
    "file_size": 421671,
    "width": 1414,
    "height": 2000,
    "tags": []
}
 

Request      

GET api/v1/images/random/{rating?}

URL Parameters

rating  string  

unknown, safe, questionable, explicit.

GET api/v1/images/{id}

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://astolfo.rocks/api/v1/images/4246',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "id": 4246,
    "rating": "safe",
    "created_at": "2021-12-06T08:30:38.000000Z",
    "updated_at": "2021-12-06T08:30:38.000000Z",
    "views": 0,
    "source": "https://www.pixiv.net/en/artworks/86487950",
    "file_extension": "jpeg",
    "mimetype": "image/jpeg",
    "file_size": 421671,
    "width": 1414,
    "height": 2000,
    "tags": []
}
 

Request      

GET api/v1/images/{id}

URL Parameters

id  integer  

The ID of the image.

GET api/v1/images

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://astolfo.rocks/api/v1/images',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


[
    {
        "id": 4246,
        "rating": "safe",
        "created_at": "2021-12-06T08:30:38.000000Z",
        "updated_at": "2021-12-06T08:30:38.000000Z",
        "views": 0,
        "source": "https://www.pixiv.net/en/artworks/86487950",
        "file_extension": "jpeg",
        "mimetype": "image/jpeg",
        "file_size": 421671,
        "width": 1414,
        "height": 2000,
        "tags": []
    }
]
 

Request      

GET api/v1/images

GET api/v1/images/rating/{rating}

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://astolfo.rocks/api/v1/images/rating/nostrum',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


[
    {
        "id": 4246,
        "rating": "safe",
        "created_at": "2021-12-06T08:30:38.000000Z",
        "updated_at": "2021-12-06T08:30:38.000000Z",
        "views": 0,
        "source": "https://www.pixiv.net/en/artworks/86487950",
        "file_extension": "jpeg",
        "mimetype": "image/jpeg",
        "file_size": 421671,
        "width": 1414,
        "height": 2000,
        "tags": []
    }
]
 

Request      

GET api/v1/images/rating/{rating}

URL Parameters

rating  string  

The rating.

Tag

GET api/v1/tags

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://astolfo.rocks/api/v1/tags',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


[
    {
        "id": 512,
        "name": "astolfo"
    }
]
 

Request      

GET api/v1/tags

GET api/v1/tags/{id}

Example request:
$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://astolfo.rocks/api/v1/tags/512',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):


{
    "id": 512,
    "name": "astolfo"
}
 

Request      

GET api/v1/tags/{id}

URL Parameters

id  integer  

The ID of the tag.