GETPlaceholder Image
https://api-random-image.dataandapis.com/v1/image
Parâmetros de consulta
| Parâmetro | Exemplo | |
|---|---|---|
| bg | cccccc | Opcional |
| color | 333333 | Opcional |
| gradient | eeeeee | Opcional |
| height | 400 | Opcional |
| text | Hello | Opcional |
| width | 600 | Opcional |
Exemplo de requisição
curl "https://api-random-image.dataandapis.com/v1/image?bg=cccccc&color=333333&gradient=eeeeee&height=400&text=Hello&width=600" \
-H "X-Api-Key: YOUR_API_KEY"// npm install dataandapis
import { DataAndApis } from "dataandapis";
const client = new DataAndApis(); // reads DATAANDAPIS_API_KEY
const file = await client.randomImage.placeholderImage({
bg: "cccccc",
color: 333333,
gradient: "eeeeee",
height: 400,
text: "Hello",
width: 600,
}); // a Blob# pip install dataandapis
from dataandapis import DataAndApis
client = DataAndApis() # reads DATAANDAPIS_API_KEY
file = client.random_image.placeholder_image(
bg="cccccc",
color=333333,
gradient="eeeeee",
height=400,
text="Hello",
width=600,
) # bytes<svg xmlns="http://www.w3.org/2000/svg" width="600" height="400" viewBox="0 0 600 400"><rect width="100%" height="100%" fill="#cccccc"/><text x="50%" y="50%" font-family="sans-serif" font-size="80" font-weight="600" fill="#333333" text-anchor="middle" dominant-baseline="central">600×400</text></svg>



