~cadence/bibliogram-docs

ref: 94680b3c3689fb0e610c23bbac5defd4191da5f0 bibliogram-docs/docs/API: Stats.md -rw-r--r-- 2.6 KiB
94680b3cCadence Ember Update instances list 7 months ago

#/api/stats/{protocol_version}

Try it! https://bibliogram.art/api/stats/2.0

#Description

Similar to Invidious's /api/v1/stats. Follows the nodeinfo protocol, or at least tries to.

Only protocol version 2.0 is supported. Not filling protocol_version in the URL will 302 redirect you to version 2.0.

#Request data

Specify which version of the Bibliogram metadata object you want to receive using the query parameter bv (e.g. ?bv=1.5).

Different instances understand different versions, but you should be able to use a direct version or any semver query to select the version. Since somewhat recently the default version is 1.x, but it used to be 1.0.

Remember, all successful responses include their version. It's a good idea to verify that you received the version that you were looking for.

#Sample response

{
    version: string,
    software: {
        name: string,
        version: string
    },
    protocols: empty[],
    services: {
        inbound: string[],
        outbound: string[]
    },
    openRegistrations: boolean,
    usage: {
        users: {
            total: number,
            activeHalfyear: number,
            activeMonth: number
        }
    },
    metadata: {
        bibliogram: {
            <bibliogram inner object>
        }
    }
}

#Sample Bibliogram inner object

{
    settings: {
        onionLocation: string?,
        canonicalOrigin: string,
        rssEnabled: boolean
    },
    availableVersions: string[],
    history: {
        (string): {
            lastRequestAt: number,
            lastRequestSuccessful: boolean
        }
    },
    features: string[],
    version: string
}

#Features list

Name Meaning
PAGE_PROFILE /u/{username} exists
PAGE_POST /p/{shortcode} exists
API_STATS /api/stats exists
API_STATS_SEMVER /api/stats supports semver queries
PAGE_HOME / homepage exists and is meaningful
API_INSTANCES /api/instances exists
BLOCK_DETECT_USER_HTML Can detect user page blocks (html)
BLOCK_DETECT_TIMELINE_GRAPHQL Can detect extended timeline data blocks (graphql)
BLOCK_DETECT_POST_GRAPHQL Can detect post data blocks (graphql)
PRIVACY_POLICY Has a privacy policy
ASSISTANT_PUBLIC Assistant API is enabled and public
ASSISTANT_PRIVATE Assistant API is enabled but a key is required