The Doras API
Updated on 22nd Jun, 2024
Write API
Integrating your Doras profile with any platform that will accept it with both read and write abilities.
Read API
/api/user/$username
https://doras.to/api/user/$username -> replacing $username
with the username you're fetching.
This will pull the users username, display name, biography, and profile picture.
{ "username": "your_username", "displayname": "Your Display Name", "bio": "Biography", "pic": "https://....." }
/user/$username/blocks
An output of every block on the users profile. As you can see it can be quite long, but that's why we've also introduced a method of filtering.
Every type of block has a different method and output, though 90% of the output will be similar to keep it consistent, and removing bloat where it's not needed to be optimized.
// This is what an average response would look like: [ { "id": "string", "created_at": "string (ISO 8601 date)", "updated_at": "string (ISO 8601 date)", "name": "string", "url": "string (URL)", "icon": "string", "colour": { "text": "string", "background": "string (hex color code)", "toggle": "boolean" }, "type": "string", "adult": "boolean", "show": "boolean", "group": "array", "options": "object", "chosen": "boolean", "selected": "boolean", }, { "id": "string", "created_at": "string (ISO 8601 date)", "updated_at": "string (ISO 8601 date)", "name": "string", "url": "string (URL)", "icon": "string", "colour": { "text": "string", "background": "string", "toggle": "boolean" }, "type": "string", "adult": "boolean", "show": "boolean", "group": "array", "options": "object", "chosen": "boolean", "selected": "boolean", }, { "id": "string", "created_at": "string (ISO 8601 date)", "updated_at": "string (ISO 8601 date)", "name": "string", "url": "string (URL)", "icon": "string", "colour": { "text": "string", "background": "string", "toggle": "boolean" }, "type": "string", "adult": "boolean", "show": "boolean", "group": "array", "options": "object", "chosen": "boolean", "selected": "boolean" }, { "id": "string", "created_at": "string (ISO 8601 date)", "updated_at": "string (ISO 8601 date)", "name": "string", "url": "string", "icon": "string", "colour": { "text": "string", "background": "string (hex color code)", "toggle": "boolean" }, "type": "string", "adult": "boolean", "show": "boolean", "group": "array", "options": { "content":"string" }, "chosen": "boolean", "selected": "boolean" }, { "id": "string", "created_at": "string (ISO 8601 date)", "updated_at": "string (ISO 8601 date)", "name": "string", "url": "string", "icon": "string", "colour": { "text": "string", "background": "string (hex color code)", "toggle": "boolean" }, "type": "string", "adult": "boolean", "show": "boolean", "group": "array", "options": { "rank": "boolean", "stars": "boolean", "prs": "boolean", "issues": "boolean", "contribs": "boolean" }, "chosen": "boolean", "selected": "boolean" }, { "id": "string", "created_at": "string (ISO 8601 date)", "updated_at": "string (ISO 8601 date)", "name": "string", "url": "string (URL)", "icon": "string", "colour": { "text": "string", "background": "string", "toggle": "boolean" }, "type": "string", "adult": "boolean", "show": "boolean", "group": "array", "options": { "size": "number", "link": "string" }, "chosen": "boolean", "selected": "boolean" } ]
Block filtering and types
Filtering is a useful way to get the data you're looking for. In the output of all the blocks, we saw the field "type": "link"
. We can use this as a selector to narrow down our searches, and save you the effort of parsing too much data.
By appending ?filter=type:$type
to the blocks fetch, we can specify what particular blocks to call.
Block Fields
Field Name | Data Type | Description |
---|---|---|
id | string | A unique identifier for the block. |
created_at | string | The date and time when the block was created. |
updated_at | string | The date and time when the block was last updated. |
type | string | The type of the block. See the "Block Types" table below for possible values. |
name | string | The name or title of the block. |
description | string | A brief description of the block (internal usage). |
category | string | The category to which the block belongs (internal usage). |
icon_react | object | An object representing the icon for the block in React format. |
url | string (URL) | The URL associated with the block. For email type, it's a string (email). |
icon | string | The icon identifier for the block. |
colour | object | An object representing the color settings for the block. |
colour.text | string | The color of the text in the block. Can be a string or a string (RGB color). |
colour.background | string | The background color of the block. Can be a string or a string (RGB color). |
colour.toggle | boolean | Indicates whether the custom color toggle is enabled for the block. |
adult | boolean | Indicates whether the block contains adult content. |
show | boolean | Indicates whether the block is visible. |
options | object | An object containing additional options specific to the block type. See the "Block Types" table below for available options. |
group | array | An array representing the group to which the block belongs. |
chosen | boolean | Indicates whether the block is chosen (internal usage). |
selected | boolean | Indicates whether the block is selected (internal usage). |
Block Types
Block Type | Available Options (related to the options section in the above table) |
---|---|
link | - |
- | |
mediakit | data (array), total_followers (boolean) |
textblock | content (string) |
twitch | hide_offline (boolean) |
podbean | - |
divider | - |
youtube | hide_offline (boolean) |
youtube_video | hide_title (boolean) |
youtube_video_latest | hide_title (boolean) |
spotify | - |
github_user | rank (boolean), stars (boolean), prs (boolean), issues (boolean), contribs (boolean) |
img | size (array), link (string, URL) |
Examples of some blocks
Link Block
{ "id": "string (UUID)", "created_at": "string (ISO 8601 date)", "updated_at": "string (ISO 8601 date)", "type": "link", "name": "string", "description": "string", "category": "string", "icon_react": "object", "url": "string (URL)", "icon": "string", "colour": { "text": "string", "background": "string", "toggle": "boolean" }, "adult": "boolean", "show": "boolean", "options": "object", "group": "array", "chosen": "boolean", "selected": "boolean" }
Mediakit
{ "id": "string (UUID)", "created_at": "string (ISO 8601 date)", "updated_at": "string (ISO 8601 date)", "type": "mediakit", "name": "string", "description": "string", "category": "string", "icon_react": "object", "url": "string", "icon": "string", "colour": { "text": "string (RGB color)", "background": "string (RGB color)", "toggle": "boolean" }, "adult": "boolean", "show": "boolean", "options": { "data": "array", "total_followers": "boolean" }, "group": "array", "chosen": "boolean", "selected": "boolean" }
...