Get a profile's bio and stats
curl --request POST \
--url https://api.stophy.dev/v1/mastodon/profile \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user": "Gargron@mastodon.social"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({user: 'Gargron@mastodon.social'})
};
fetch('https://api.stophy.dev/v1/mastodon/profile', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.stophy.dev/v1/mastodon/profile"
payload = { "user": "Gargron@mastodon.social" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"profile": {
"url": "<string>",
"isBot": true,
"isLocked": true,
"isGroup": true,
"id": "<string>",
"username": "<string>",
"name": "<string>",
"bio": "<string>",
"bioHtml": "<string>",
"avatar": "<string>",
"banner": "<string>",
"followers": 0,
"following": 0,
"posts": 0,
"fields": [
{
"name": "<string>",
"value": "<string>",
"verifiedAt": "2023-11-07T05:31:56Z"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"lastPostAt": "2023-11-07T05:31:56Z"
}
},
"creditsUsed": 123,
"requestId": "<string>"
}{
"success": false,
"error": {
"code": "cliSessionCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123
}
}{
"success": false,
"error": {
"code": "cliSessionCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123
}
}Mastodon
Mastodon profile API
Call the Mastodon profile API to get username, name, bio, bio html, avatar and banner, as JSON or markdown. 1 credit.
POST
/
v1
/
mastodon
/
profile
Get a profile's bio and stats
curl --request POST \
--url https://api.stophy.dev/v1/mastodon/profile \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"user": "Gargron@mastodon.social"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({user: 'Gargron@mastodon.social'})
};
fetch('https://api.stophy.dev/v1/mastodon/profile', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.stophy.dev/v1/mastodon/profile"
payload = { "user": "Gargron@mastodon.social" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"profile": {
"url": "<string>",
"isBot": true,
"isLocked": true,
"isGroup": true,
"id": "<string>",
"username": "<string>",
"name": "<string>",
"bio": "<string>",
"bioHtml": "<string>",
"avatar": "<string>",
"banner": "<string>",
"followers": 0,
"following": 0,
"posts": 0,
"fields": [
{
"name": "<string>",
"value": "<string>",
"verifiedAt": "2023-11-07T05:31:56Z"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"lastPostAt": "2023-11-07T05:31:56Z"
}
},
"creditsUsed": 123,
"requestId": "<string>"
}{
"success": false,
"error": {
"code": "cliSessionCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123
}
}{
"success": false,
"error": {
"code": "cliSessionCompleted",
"message": "<string>",
"retryable": true,
"requestId": "<string>",
"retryAfterSeconds": 123
}
}- Endpoint:
mastodon.profile - Returns:
datahasprofile. - Cost: 1 credit. Failed calls cost nothing.
- Paging: No.
Example
import { Stophy } from "stophy";
const stophy = new Stophy({ apiKey: process.env.STOPHY_API_KEY });
const result = await stophy.mastodon.profile({ user: "Gargron@mastodon.social" });
console.log(result.data.profile);
from stophy import Stophy
stophy = Stophy() # reads STOPHY_API_KEY
result = stophy.mastodon.profile(user="Gargron@mastodon.social")
print(result["data"]["profile"])
curl -X POST https://api.stophy.dev/v1/mastodon/profile \
-H "Authorization: Bearer $STOPHY_API_KEY" \
-H "content-type: application/json" \
-d '{"user":"Gargron@mastodon.social"}'
stophy mastodon profile Gargron@mastodon.social
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json