Media Resource Documentation
Built-in dynamic SVG avatar and landscape thumbnail placeholder image generator helper endpoints (/public/avatars/:seed.svg and /public/thumbnails/:seed.svg) for frontends and prototypes.
| Name | Type | Required | Location | Description |
|---|---|---|---|---|
seed |
String (Required) |
Optional | ||
size |
Integer (Query) |
Optional | ||
rounded |
Boolean (Query) |
Optional |
curl -X
GET 'http://playground-api-xi.vercel.app/public/avatars/:seed.svg' \
-H 'Content-Type: application/json' \
-b "pg_identity=your_cookie_uuid"
fetch('http://playground-api-xi.vercel.app/public/avatars/:seed.svg', {
method: 'GET' ,
credentials: 'include'
})
.then(res=>
res.json())
.then(data => console.log(data));
import axios from 'axios';
axios.get('http://playground-api-xi.vercel.app/public/avatars/:seed.svg', {
withCredentials: true
}).then(response =>
console.log(response.data));
import requests
response = requests.get('http://playground-api-xi.vercel.app/public/avatars/:seed.svg')
print(response.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "http://playground-api-xi.vercel.app/public/avatars/:seed.svg"
req,
err := http.NewRequest("GET", url, nil)
if err != nil
{
panic(err)
}
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp,
err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ :=
io.ReadAll(resp.Body)
fmt.Println(string(body))
}
import Foundation
let url = URL(string: "http://playground-api-xi.vercel.app/public/avatars/:seed.svg")!
var request = URLRequest(url:
url)
request.httpMethod = "GET"
request.setValue("application/json", forHTTPHeaderField:
"Content-Type")
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data =
data, error == nil else { return }
let responseString = String(data: data, encoding: .utf8)
print(responseString
?? "")
}
task.resume()
import okhttp3.OkHttpClient
import okhttp3.Request
val client = OkHttpClient()
val request =
Request.Builder()
.url("http://playground-api-xi.vercel.app/public/avatars/:seed.svg")
.get()
.addHeader("Content-Type",
"application/json")
.build()
client.newCall(request).execute().use { response ->
println(response.body?.string())
}
use reqwest::Error;
#[tokio::main]
async fn main() -> Result<(), Error> {
let client =
reqwest::Client::new();
let response = client
.get("http://playground-api-xi.vercel.app/public/avatars/:seed.svg")
.header("Content-Type", "application/json")
.send()
.await?
.text()
.await?;
println!("{}", response);
Ok(())
}
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('GET', 'http://playground-api-xi.vercel.app/public/avatars/:seed.svg', [
'headers' => [
'Content-Type' => 'application/json'
]
]);
echo $response->getBody();
Response Schema Example
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" width="128" height="128">
<defs>
<linearGradient id="grad-12345" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stop-color="#059669" />
<stop offset="100%" stop-color="#0d9488" />
</linearGradient>
</defs>
<rect width="128" height="128" rx="64" fill="url(#grad-12345)" />
<text x="50%" y="54%" font-family="Inter, sans-serif" font-size="54" font-weight="700" fill="#ffffff" text-anchor="middle" dominant-baseline="middle">BR</text>
</svg>
โก Try it out โ Test endpoint live Test now
| Name | Type | Required | Location | Description |
|---|---|---|---|---|
seed |
String (Required) |
Optional | ||
width |
Integer (Query) |
Optional | ||
height |
Integer (Query) |
Optional | ||
text |
String (Query) |
Optional |
curl -X
GET 'http://playground-api-xi.vercel.app/public/thumbnails/:seed.svg' \
-H 'Content-Type: application/json' \
-b "pg_identity=your_cookie_uuid"
fetch('http://playground-api-xi.vercel.app/public/thumbnails/:seed.svg', {
method: 'GET' ,
credentials: 'include'
})
.then(res=>
res.json())
.then(data => console.log(data));
import axios from 'axios';
axios.get('http://playground-api-xi.vercel.app/public/thumbnails/:seed.svg', {
withCredentials: true
}).then(response =>
console.log(response.data));
import requests
response = requests.get('http://playground-api-xi.vercel.app/public/thumbnails/:seed.svg')
print(response.json())
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
url := "http://playground-api-xi.vercel.app/public/thumbnails/:seed.svg"
req,
err := http.NewRequest("GET", url, nil)
if err != nil
{
panic(err)
}
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp,
err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ :=
io.ReadAll(resp.Body)
fmt.Println(string(body))
}
import Foundation
let url = URL(string: "http://playground-api-xi.vercel.app/public/thumbnails/:seed.svg")!
var request = URLRequest(url:
url)
request.httpMethod = "GET"
request.setValue("application/json", forHTTPHeaderField:
"Content-Type")
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data =
data, error == nil else { return }
let responseString = String(data: data, encoding: .utf8)
print(responseString
?? "")
}
task.resume()
import okhttp3.OkHttpClient
import okhttp3.Request
val client = OkHttpClient()
val request =
Request.Builder()
.url("http://playground-api-xi.vercel.app/public/thumbnails/:seed.svg")
.get()
.addHeader("Content-Type",
"application/json")
.build()
client.newCall(request).execute().use { response ->
println(response.body?.string())
}
use reqwest::Error;
#[tokio::main]
async fn main() -> Result<(), Error> {
let client =
reqwest::Client::new();
let response = client
.get("http://playground-api-xi.vercel.app/public/thumbnails/:seed.svg")
.header("Content-Type", "application/json")
.send()
.await?
.text()
.await?;
println!("{}", response);
Ok(())
}
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('GET', 'http://playground-api-xi.vercel.app/public/thumbnails/:seed.svg', [
'headers' => [
'Content-Type' => 'application/json'
]
]);
echo $response->getBody();
Response Schema Example
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 400" width="600" height="400">
<defs>
<linearGradient id="thumb-grad-54321" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" stop-color="#4f46e5" />
<stop offset="100%" stop-color="#7c3aed" />
</linearGradient>
</defs>
<rect width="600" height="400" fill="url(#thumb-grad-54321)" />
<text x="50%" y="46%" font-family="Inter, sans-serif" font-size="33" font-weight="700" fill="#ffffff" text-anchor="middle" dominant-baseline="middle">Post #1</text>
</svg>