默认分类 2023 年 10 月 27 日

博客公开API信息

RSS

URI: /feed | Method: GET

Return RSS

Public API

Lists articles

URI: /api/content/posts | Method: GET

Query parameters

Parameter Required Type Comment
offset false integer (int) the number of records to skip before starting to return the records
limit false integer (int) the max number of records to retrieve

Example

{
    "code": 200,
    "data": [
        {
            "id": 1,
            "title": "Article title",
            "link": "Article route",
            "summary": "Article description",
            "category": "Article category",
            "cover_img": "Article cover image",
            "created_time": Timestamp when the article was first published
        },
      ...
    ]
}

Gets an article

URI: /api/content/posts/:id | Method: GET

Path parameters

Parameter Required Type Comment
id true integer (int) Article ID

Example

{
    "code": 200,
    "data": {
        "id": 1,
        "title": "Article title",
        "link": "Article route",
        "content": "Article content (Markdown)",
        "summary": "Article description",
        "category": "Article category",
        "cover_img": "Article cover image",
        "created_time": Timestamp when the article was first published
    }
}

Lists standalone pages

URI: /api/content/sheets | Method: GET

Query parameters

Parameter Required Type Comment
offset false integer (int) the number of records to skip before starting to return the records
limit false integer (int) the max number of records to retrieve

Example

{
    "code": 200,
    "data": [
        {
            "id": 1,
            "title": "Page title",
            "link": "Page route",
            "summary": "Page description",
            "created_time": Timestamp when the page was first published
        }
    ]
}

Gets a standalone page

URI: /api/content/sheets/:id | Method: GET

Path parameters

Parameter Required Type Comment
id true integer (int) Standalone page ID

Example

{
    "code": 200,
    "data": {
        "id": 1,
        "title": "Page title",
        "link": "Page route",
        "content": "Page content(Markdown)",
        "summary": "Page description",
        "created_time": Timestamp when the page was first published
    }
}

Lists Friends

URI: /api/content/friends | Method: GET

Query parameters

Parameter Required Type Comment
offset false integer (int) the number of records to skip before starting to return the records
limit false integer (int) the max number of records to retrieve

Example

{
    "code": 200,
    "data": [
        {
            "id": 1,
            "name": "Friend's name",
            "link": "Friend's link",
            "description": "Friend's description",
            "avatar": "Friend's avatar"
        },
      ...
    ]
}

Lists Categories

URI: /api/content/categories | Method: GET

Query parameters

Parameter Required Type Comment
offset false integer (int) the number of records to skip before starting to return the records
limit false integer (int) the max number of records to retrieve

Example

{
    "code": 200,
    "data": [
        {
            "id": 1,
            "title": "Category name",
            "link": "Category route"
        },
      ...
    ]
}

Lists articles by category

URI: /api/content/categories/:id | Method: GET

Path parameters

Parameter Required Type Comment
id true integer (int) Category ID

Query parameters

Parameter Required Type Comment
offset false integer (int) the number of records to skip before starting to return the records
limit false integer (int) the max number of records to retrieve

Example

{
    "code": 200,
    "data": [
        {
            "id": 1,
            "title": "Article title",
            "link": "Article route",
            "summary": "Article description",
            "category": "Article category",
            "cover_img": "Article cover image",
            "created_time": Timestamp when the article was first published
        },
      ...
    ]
}