Ir al contenido
v2.7

Avatars

Imágenes listas: iniciales, banderas, íconos de navegador y de tarjeta, favicons y códigos QR.

Imágenes listas: iniciales, banderas, íconos de navegador y de tarjeta, favicons y códigos QR.

Clase Avatars: 11 métodos (11 en @owbase/web, 11 en @owbase/node). Las descripciones de los métodos están en inglés. Los ejemplos usan la forma de objeto de los parámetros; cambia los valores entre < y > por los tuyos.

Obtener ícono del navegador

GET /avatars/browsers/{code} · página del método

SDK: @owbase/web y @owbase/node

You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user GET /account/sessions endpoint. Use width, height and quality arguments to change the output settings.

When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.

Parámetro Tipo Obligatorio Descripción
code Browser sí Browser Code. Valores: aa, an, ch, ci, cm, cr, ff, sf, mf, ps, oi, om, op, on.
width number no Image width. Pass an integer between 0 to 2000. Defaults to 100.
height number no Image height. Pass an integer between 0 to 2000. Defaults to 100.
quality number no Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.

Acceso: clave de API con el alcance avatars.read o sin clave ni sesión: basta el ID del proyecto.

@owbase/web
import { Client, Avatars, Browser } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const avatars = new Avatars(client);
const result = avatars.getBrowser({
code: Browser.AvantBrowser,
width: 0, // optional
height: 0, // optional
quality: -1, // optional
});
console.log(result);
@owbase/node
import { Client, Avatars, Browser } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const avatars = new Avatars(client);
const result = await avatars.getBrowser({
code: Browser.AvantBrowser,
width: 0, // optional
height: 0, // optional
quality: -1, // optional
});

Obtener ícono de tarjeta de crédito

GET /avatars/credit-cards/{code} · página del método

SDK: @owbase/web y @owbase/node

The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.

When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.

Parámetro Tipo Obligatorio Descripción
code CreditCard sí Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay. Valores: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.
width number no Image width. Pass an integer between 0 to 2000. Defaults to 100.
height number no Image height. Pass an integer between 0 to 2000. Defaults to 100.
quality number no Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.

Acceso: clave de API con el alcance avatars.read o sin clave ni sesión: basta el ID del proyecto.

@owbase/web
import { Client, Avatars, CreditCard } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const avatars = new Avatars(client);
const result = avatars.getCreditCard({
code: CreditCard.AmericanExpress,
width: 0, // optional
height: 0, // optional
quality: -1, // optional
});
console.log(result);
@owbase/node
import { Client, Avatars, CreditCard } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const avatars = new Avatars(client);
const result = await avatars.getCreditCard({
code: CreditCard.AmericanExpress,
width: 0, // optional
height: 0, // optional
quality: -1, // optional
});

Obtener favicon

GET /avatars/favicon · página del método

SDK: @owbase/web y @owbase/node

Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.

This endpoint does not follow HTTP redirects.

Parámetro Tipo Obligatorio Descripción
url string sí Website URL which you want to fetch the favicon from.

Acceso: clave de API con el alcance avatars.read o sin clave ni sesión: basta el ID del proyecto.

@owbase/web
import { Client, Avatars } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const avatars = new Avatars(client);
const result = avatars.getFavicon({
url: 'https://example.com',
});
console.log(result);
@owbase/node
import { Client, Avatars } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const avatars = new Avatars(client);
const result = await avatars.getFavicon({
url: 'https://example.com',
});

Obtener bandera del país

GET /avatars/flags/{code} · página del método

SDK: @owbase/web y @owbase/node

You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the ISO 3166-1 standard.

When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.

Parámetro Tipo Obligatorio Descripción
code Flag sí Country Code. ISO Alpha-2 country code format. Valores: af, ao, al, ad, ae, ar, am, ag, au, at, az, bi, be, bj, bf, bd, bg, bh, bs, ba, by, bz, bo, br, bb, bn, bt, bw, cf, ca, ch, cl, cn, ci, cm, cd, cg, co, km, cv, cr, cu, cy, cz, de, dj, dm, dk, do, dz, ec, eg, er, es, ee, et, fi, fj, fr, fm, ga, gb, ge, gh, gn, gm, gw, gq, gr, gd, gt, gy, hn, hr, ht, hu, id, in, ie, ir, iq, is, il, it, jm, jo, jp, kz, ke, kg, kh, ki, kn, kr, kw, la, lb, lr, ly, lc, li, lk, ls, lt, lu, lv, ma, mc, md, mg, mv, mx, mh, mk, ml, mt, mm, me, mn, mz, mr, mu, mw, my, na, ne, ng, ni, nl, no, np, nr, nz, om, pk, pa, pe, ph, pw, pg, pl, pf, kp, pt, py, qa, ro, ru, rw, sa, sd, sn, sg, sb, sl, sv, sm, so, rs, ss, st, sr, sk, si, se, sz, sc, sy, td, tg, th, tj, tm, tl, to, tt, tn, tr, tv, tz, ug, ua, uy, us, uz, va, vc, ve, vn, vu, ws, ye, za, zm, zw.
width number no Image width. Pass an integer between 0 to 2000. Defaults to 100.
height number no Image height. Pass an integer between 0 to 2000. Defaults to 100.
quality number no Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.

Acceso: clave de API con el alcance avatars.read o sin clave ni sesión: basta el ID del proyecto.

@owbase/web
import { Client, Avatars, Flag } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const avatars = new Avatars(client);
const result = avatars.getFlag({
code: Flag.Afghanistan,
width: 0, // optional
height: 0, // optional
quality: -1, // optional
});
console.log(result);
@owbase/node
import { Client, Avatars, Flag } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const avatars = new Avatars(client);
const result = await avatars.getFlag({
code: Flag.Afghanistan,
width: 0, // optional
height: 0, // optional
quality: -1, // optional
});

Obtener imagen desde una URL

GET /avatars/image · página del método

SDK: @owbase/web y @owbase/node

Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.

When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.

This endpoint does not follow HTTP redirects.

Parámetro Tipo Obligatorio Descripción
url string sí Image URL which you want to crop.
width number no Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.
height number no Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.

Acceso: clave de API con el alcance avatars.read o sin clave ni sesión: basta el ID del proyecto.

@owbase/web
import { Client, Avatars } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const avatars = new Avatars(client);
const result = avatars.getImage({
url: 'https://example.com',
width: 0, // optional
height: 0, // optional
});
console.log(result);
@owbase/node
import { Client, Avatars } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const avatars = new Avatars(client);
const result = await avatars.getImage({
url: 'https://example.com',
width: 0, // optional
height: 0, // optional
});

Obtener iniciales del usuario

GET /avatars/initials · página del método

SDK: @owbase/web y @owbase/node

Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the ‘name’ parameter. If no name is given and no user is logged, an empty avatar will be returned.

You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user’s initials when reloading the same theme will always return for the same initials.

When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.

Parámetro Tipo Obligatorio Descripción
name string no Full Name. When empty, current user name or email will be used. Max length: 128 chars.
width number no Image width. Pass an integer between 0 to 2000. Defaults to 100.
height number no Image height. Pass an integer between 0 to 2000. Defaults to 100.
background string no Changes background color. By default a random color will be picked and stay will persistent to the given name.

Acceso: clave de API con el alcance avatars.read o sin clave ni sesión: basta el ID del proyecto.

@owbase/web
import { Client, Avatars } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const avatars = new Avatars(client);
const result = avatars.getInitials({
name: '<NAME>', // optional
width: 0, // optional
height: 0, // optional
background: 'FFFFFF', // optional
});
console.log(result);
@owbase/node
import { Client, Avatars } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const avatars = new Avatars(client);
const result = await avatars.getInitials({
name: '<NAME>', // optional
width: 0, // optional
height: 0, // optional
background: 'FFFFFF', // optional
});

Obtener foto del usuario

GET /avatars/photo · página del método

SDK: @owbase/web y @owbase/node

Returns the best available profile photo for a user. The endpoint tries each source in priority order and returns the first successful result: a custom uploaded photo (see avatars.updatePhoto), OAuth2 identity photo, Gravatar, Libravatar, Owbase Initials, built-in static fallback.

Passing userId — current() for the authenticated user — resolves the photo from everything known about that user: identity photos, email, and name. An explicit emailHash or name then overrides just that value, and the user’s remaining sources stay in the chain. Without userId, passing emailHash and/or name resolves the avatar from those values alone: the hash is looked up on Gravatar and Libravatar, the name is rendered as initials, and the session user stays out of the chain so their own photo never shadows the avatar being asked for. When nothing is passed, the photo resolves for the currently authenticated user. Emails are only ever accepted pre-hashed, so no address ends up in a URL.

Parámetro Tipo Obligatorio Descripción
width number no Output image width in pixels. Pass an integer between 0 and 2000. Defaults to 256.
height number no Output image height in pixels. Pass an integer between 0 and 2000. Defaults to 256.
quality number no Output image quality between 0 and 100. Defaults to 100.
output string no Output image format. Defaults to ‘png’.
rating string no Maximum image rating to fetch from Gravatar/Libravatar. Defaults to ‘g’.
userId string no User ID to resolve the photo for. Pass ‘current()’ for the currently authenticated user. When omitted, the session user is used only if no emailHash and no name is passed.
emailHash string no SHA256 hash of the lowercase, trimmed email address to look up on Gravatar and Libravatar instead of the user’s own email. Pass the hash, never the address itself.
name string no Name to render initials from instead of the user’s own name. Max length: 128 chars.

Acceso: clave de API con el alcance avatars.read o sin clave ni sesión: basta el ID del proyecto.

@owbase/web
import { Client, Avatars } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const avatars = new Avatars(client);
const result = avatars.getPhoto({
width: 0, // optional
height: 0, // optional
quality: 0, // optional
output: 'png', // optional
rating: 'g', // optional
userId: 'current()', // optional
emailHash: '<EMAIL_HASH>', // optional
name: '<NAME>', // optional
});
console.log(result);
@owbase/node
import { Client, Avatars } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const avatars = new Avatars(client);
const result = await avatars.getPhoto({
width: 0, // optional
height: 0, // optional
quality: 0, // optional
output: 'png', // optional
rating: 'g', // optional
userId: 'current()', // optional
emailHash: '<EMAIL_HASH>', // optional
name: '<NAME>', // optional
});

Actualizar foto

PUT /avatars/photo · página del método

SDK: @owbase/web y @owbase/node

Update the profile photo of the currently authenticated user. The uploaded image takes priority over every other photo source, including OAuth2 identity photos, Gravatar, and Libravatar. Updating an already customized photo replaces it. The image must be at most 5MB and is sent in a single request.

Parámetro Tipo Obligatorio Descripción
file File (en node, también InputFile) sí Binary image file of at most 5MB. Allowed file types are png, jpg, jpeg, and webp.
onProgress (progress: UploadProgress) => void no Callback called after each uploaded chunk with the upload progress ($id, progress in percent, sizeUploaded, chunksTotal, chunksUploaded).

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
import { Client, Avatars } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const avatars = new Avatars(client);
const result = await avatars.updatePhoto({
file: document.getElementById('uploader').files[0],
});
console.log(result);
@owbase/node
import { Client, Avatars } from '@owbase/node';
import { InputFile } from '@owbase/node/file';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const avatars = new Avatars(client);
const result = await avatars.updatePhoto({
file: InputFile.fromPath('/path/to/file', 'filename'),
});

Eliminar foto

DELETE /avatars/photo · página del método

SDK: @owbase/web y @owbase/node

Delete the profile photo of the currently authenticated user and store the built-in static placeholder in its place. The placeholder is the user’s photo from then on, so it takes priority over every other photo source — OAuth2 identity photos, Gravatar, Libravatar, and initials — until a new photo is uploaded with avatars.updatePhoto.

Sin parámetros.

Acceso: sesión del usuario (vale lo que permitan los permisos del recurso).

@owbase/web
import { Client, Avatars } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const avatars = new Avatars(client);
const result = await avatars.deletePhoto();
console.log(result);
@owbase/node
import { Client, Avatars } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const avatars = new Avatars(client);
const result = await avatars.deletePhoto();

Obtener código QR

GET /avatars/qr · página del método

SDK: @owbase/web y @owbase/node

Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.

Parámetro Tipo Obligatorio Descripción
text string sí Plain text to be converted to QR code image.
size number no QR code size. Pass an integer between 1 to 1000. Defaults to 400.
margin number no Margin from edge. Pass an integer between 0 to 10. Defaults to 1.
download boolean no Return resulting image with ’Content-Disposition: attachment ’ headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.

Acceso: clave de API con el alcance avatars.read o sin clave ni sesión: basta el ID del proyecto.

@owbase/web
import { Client, Avatars } from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const avatars = new Avatars(client);
const result = avatars.getQR({
text: '<TEXT>',
size: 1, // optional
margin: 0, // optional
download: false, // optional
});
console.log(result);
@owbase/node
import { Client, Avatars } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const avatars = new Avatars(client);
const result = await avatars.getQR({
text: '<TEXT>',
size: 1, // optional
margin: 0, // optional
download: false, // optional
});

Obtener captura de una página web

GET /avatars/screenshots · página del método

SDK: @owbase/web y @owbase/node

Use this endpoint to capture a screenshot of any website URL. This endpoint uses a headless browser to render the webpage and capture it as an image.

You can configure the browser viewport size, theme, user agent, geolocation, permissions, and more. Capture either just the viewport or the full page scroll.

When width and height are specified, the image is resized accordingly. If both dimensions are 0, the API provides an image at original size. If dimensions are not specified, the default viewport size is 1280x720px.

Parámetro Tipo Obligatorio Descripción
url string sí Website URL which you want to capture.
headers object no HTTP headers to send with the browser request. Only Accept and Accept-Language are allowed. Defaults to empty.
viewportWidth number no Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280.
viewportHeight number no Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720.
scale number no Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1.
theme BrowserTheme no Browser theme. Pass “light” or “dark”. Defaults to “light”. Valores: light, dark.
userAgent string no Custom user agent string. Defaults to browser default.
fullpage boolean no Capture full page scroll. Pass 0 for viewport only, or 1 for full page. Defaults to 0.
locale string no Browser locale (e.g., “en-US”, “fr-FR”). Defaults to browser default.
timezone Timezone no IANA timezone identifier (e.g., “America/New_York”, “Europe/London”). Defaults to browser default. Valores: africa/abidjan, africa/accra, africa/addis_ababa, africa/algiers, africa/asmara, africa/bamako, africa/bangui, africa/banjul, africa/bissau, africa/blantyre, africa/brazzaville, africa/bujumbura, africa/cairo, africa/casablanca, africa/ceuta, africa/conakry, africa/dakar, africa/dar_es_salaam, africa/djibouti, africa/douala, africa/el_aaiun, africa/freetown, africa/gaborone, africa/harare, africa/johannesburg, africa/juba, africa/kampala, africa/khartoum, africa/kigali, africa/kinshasa, africa/lagos, africa/libreville, africa/lome, africa/luanda, africa/lubumbashi, africa/lusaka, africa/malabo, africa/maputo, africa/maseru, africa/mbabane, africa/mogadishu, africa/monrovia, africa/nairobi, africa/ndjamena, africa/niamey, africa/nouakchott, africa/ouagadougou, africa/porto-novo, africa/sao_tome, africa/tripoli, africa/tunis, africa/windhoek, america/adak, america/anchorage, america/anguilla, america/antigua, america/araguaina, america/argentina/buenos_aires, america/argentina/catamarca, america/argentina/cordoba, america/argentina/jujuy, america/argentina/la_rioja, america/argentina/mendoza, america/argentina/rio_gallegos, america/argentina/salta, america/argentina/san_juan, america/argentina/san_luis, america/argentina/tucuman, america/argentina/ushuaia, america/aruba, america/asuncion, america/atikokan, america/bahia, america/bahia_banderas, america/barbados, america/belem, america/belize, america/blanc-sablon, america/boa_vista, america/bogota, america/boise, america/cambridge_bay, america/campo_grande, america/cancun, america/caracas, america/cayenne, america/cayman, america/chicago, america/chihuahua, america/ciudad_juarez, america/costa_rica, america/coyhaique, america/creston, america/cuiaba, america/curacao, america/danmarkshavn, america/dawson, america/dawson_creek, america/denver, america/detroit, america/dominica, america/edmonton, america/eirunepe, america/el_salvador, america/fort_nelson, america/fortaleza, america/glace_bay, america/goose_bay, america/grand_turk, america/grenada, america/guadeloupe, america/guatemala, america/guayaquil, america/guyana, america/halifax, america/havana, america/hermosillo, america/indiana/indianapolis, america/indiana/knox, america/indiana/marengo, america/indiana/petersburg, america/indiana/tell_city, america/indiana/vevay, america/indiana/vincennes, america/indiana/winamac, america/inuvik, america/iqaluit, america/jamaica, america/juneau, america/kentucky/louisville, america/kentucky/monticello, america/kralendijk, america/la_paz, america/lima, america/los_angeles, america/lower_princes, america/maceio, america/managua, america/manaus, america/marigot, america/martinique, america/matamoros, america/mazatlan, america/menominee, america/merida, america/metlakatla, america/mexico_city, america/miquelon, america/moncton, america/monterrey, america/montevideo, america/montserrat, america/nassau, america/new_york, america/nome, america/noronha, america/north_dakota/beulah, america/north_dakota/center, america/north_dakota/new_salem, america/nuuk, america/ojinaga, america/panama, america/paramaribo, america/phoenix, america/port-au-prince, america/port_of_spain, america/porto_velho, america/puerto_rico, america/punta_arenas, america/rankin_inlet, america/recife, america/regina, america/resolute, america/rio_branco, america/santarem, america/santiago, america/santo_domingo, america/sao_paulo, america/scoresbysund, america/sitka, america/st_barthelemy, america/st_johns, america/st_kitts, america/st_lucia, america/st_thomas, america/st_vincent, america/swift_current, america/tegucigalpa, america/thule, america/tijuana, america/toronto, america/tortola, america/vancouver, america/whitehorse, america/winnipeg, america/yakutat, antarctica/casey, antarctica/davis, antarctica/dumontdurville, antarctica/macquarie, antarctica/mawson, antarctica/mcmurdo, antarctica/palmer, antarctica/rothera, antarctica/syowa, antarctica/troll, antarctica/vostok, arctic/longyearbyen, asia/aden, asia/almaty, asia/amman, asia/anadyr, asia/aqtau, asia/aqtobe, asia/ashgabat, asia/atyrau, asia/baghdad, asia/bahrain, asia/baku, asia/bangkok, asia/barnaul, asia/beirut, asia/bishkek, asia/brunei, asia/chita, asia/colombo, asia/damascus, asia/dhaka, asia/dili, asia/dubai, asia/dushanbe, asia/famagusta, asia/gaza, asia/hebron, asia/ho_chi_minh, asia/hong_kong, asia/hovd, asia/irkutsk, asia/jakarta, asia/jayapura, asia/jerusalem, asia/kabul, asia/kamchatka, asia/karachi, asia/kathmandu, asia/khandyga, asia/kolkata, asia/krasnoyarsk, asia/kuala_lumpur, asia/kuching, asia/kuwait, asia/macau, asia/magadan, asia/makassar, asia/manila, asia/muscat, asia/nicosia, asia/novokuznetsk, asia/novosibirsk, asia/omsk, asia/oral, asia/phnom_penh, asia/pontianak, asia/pyongyang, asia/qatar, asia/qostanay, asia/qyzylorda, asia/riyadh, asia/sakhalin, asia/samarkand, asia/seoul, asia/shanghai, asia/singapore, asia/srednekolymsk, asia/taipei, asia/tashkent, asia/tbilisi, asia/tehran, asia/thimphu, asia/tokyo, asia/tomsk, asia/ulaanbaatar, asia/urumqi, asia/ust-nera, asia/vientiane, asia/vladivostok, asia/yakutsk, asia/yangon, asia/yekaterinburg, asia/yerevan, atlantic/azores, atlantic/bermuda, atlantic/canary, atlantic/cape_verde, atlantic/faroe, atlantic/madeira, atlantic/reykjavik, atlantic/south_georgia, atlantic/st_helena, atlantic/stanley, australia/adelaide, australia/brisbane, australia/broken_hill, australia/darwin, australia/eucla, australia/hobart, australia/lindeman, australia/lord_howe, australia/melbourne, australia/perth, australia/sydney, europe/amsterdam, europe/andorra, europe/astrakhan, europe/athens, europe/belgrade, europe/berlin, europe/bratislava, europe/brussels, europe/bucharest, europe/budapest, europe/busingen, europe/chisinau, europe/copenhagen, europe/dublin, europe/gibraltar, europe/guernsey, europe/helsinki, europe/isle_of_man, europe/istanbul, europe/jersey, europe/kaliningrad, europe/kirov, europe/kyiv, europe/lisbon, europe/ljubljana, europe/london, europe/luxembourg, europe/madrid, europe/malta, europe/mariehamn, europe/minsk, europe/monaco, europe/moscow, europe/oslo, europe/paris, europe/podgorica, europe/prague, europe/riga, europe/rome, europe/samara, europe/san_marino, europe/sarajevo, europe/saratov, europe/simferopol, europe/skopje, europe/sofia, europe/stockholm, europe/tallinn, europe/tirane, europe/ulyanovsk, europe/vaduz, europe/vatican, europe/vienna, europe/vilnius, europe/volgograd, europe/warsaw, europe/zagreb, europe/zurich, indian/antananarivo, indian/chagos, indian/christmas, indian/cocos, indian/comoro, indian/kerguelen, indian/mahe, indian/maldives, indian/mauritius, indian/mayotte, indian/reunion, pacific/apia, pacific/auckland, pacific/bougainville, pacific/chatham, pacific/chuuk, pacific/easter, pacific/efate, pacific/fakaofo, pacific/fiji, pacific/funafuti, pacific/galapagos, pacific/gambier, pacific/guadalcanal, pacific/guam, pacific/honolulu, pacific/kanton, pacific/kiritimati, pacific/kosrae, pacific/kwajalein, pacific/majuro, pacific/marquesas, pacific/midway, pacific/nauru, pacific/niue, pacific/norfolk, pacific/noumea, pacific/pago_pago, pacific/palau, pacific/pitcairn, pacific/pohnpei, pacific/port_moresby, pacific/rarotonga, pacific/saipan, pacific/tahiti, pacific/tarawa, pacific/tongatapu, pacific/wake, pacific/wallis, utc.
latitude number no Geolocation latitude. Pass a number between -90 to 90. Defaults to 0.
longitude number no Geolocation longitude. Pass a number between -180 to 180. Defaults to 0.
accuracy number no Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0.
touch boolean no Enable touch support. Pass 0 for no touch, or 1 for touch enabled. Defaults to 0.
permissions BrowserPermission[] no Browser permissions to grant. Pass an array of permission names like [“geolocation”, “camera”, “microphone”]. Defaults to empty. Valores: geolocation, camera, microphone, notifications, midi, push, clipboard-read, clipboard-write, payment-handler, usb, bluetooth, accelerometer, gyroscope, magnetometer, ambient-light-sensor, background-sync, persistent-storage, screen-wake-lock, web-share, xr-spatial-tracking.
sleep number no Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0.
width number no Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width).
height number no Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height).
quality number no Screenshot quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
output ImageFormat no Output format type (jpeg, jpg, png, gif and webp). Valores: jpg, jpeg, png, webp, heic, avif, gif.

Acceso: clave de API con el alcance avatars.read o sin clave ni sesión: basta el ID del proyecto.

@owbase/web
import {
Client,
Avatars,
BrowserTheme,
Timezone,
BrowserPermission,
ImageFormat,
} from '@owbase/web';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const avatars = new Avatars(client);
const result = avatars.getScreenshot({
url: 'https://example.com',
headers: {
'Accept-Language': 'en-US,en;q=0.9',
}, // optional
viewportWidth: 1920, // optional
viewportHeight: 1080, // optional
scale: 2, // optional
theme: BrowserTheme.Dark, // optional
userAgent:
'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // optional
fullpage: true, // optional
locale: 'en-US', // optional
timezone: Timezone.AfricaAbidjan, // optional
latitude: 37.7749, // optional
longitude: -122.4194, // optional
accuracy: 100, // optional
touch: true, // optional
permissions: [
BrowserPermission.Geolocation,
BrowserPermission.Notifications,
], // optional
sleep: 3, // optional
width: 800, // optional
height: 600, // optional
quality: 85, // optional
output: ImageFormat.Jpeg, // optional
});
console.log(result);
@owbase/node
import { Client, Avatars, BrowserTheme, Timezone, BrowserPermission, ImageFormat } from '@owbase/node';
const client = new Client()
.setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
const avatars = new Avatars(client);
const result = await avatars.getScreenshot({
url: 'https://example.com',
headers: {
'Accept-Language': 'en-US,en;q=0.9',
}, // optional
viewportWidth: 1920, // optional
viewportHeight: 1080, // optional
scale: 2, // optional
theme: BrowserTheme.Dark, // optional
userAgent:
'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // optional
fullpage: true, // optional
locale: 'en-US', // optional
timezone: Timezone.AfricaAbidjan, // optional
latitude: 37.7749, // optional
longitude: -122.4194, // optional
accuracy: 100, // optional
touch: true, // optional
permissions: [
BrowserPermission.Geolocation,
BrowserPermission.Notifications,
], // optional
sleep: 3, // optional
width: 800, // optional
height: 600, // optional
quality: 85, // optional
output: ImageFormat.Jpeg, // optional
});

Las descripciones de esta página vienen de la especificación de la API del servidor (licencia BSD-3-Clause), en inglés, y los ejemplos vienen del generador de SDKs (licencia MIT). Los avisos completos están en el archivo NOTICE de los paquetes @owbase/web y @owbase/node.

¿Te ayudó esta página?