Get multiple media items with all quality variants
curl --request POST \
--url https://api.ofauth.com/v2/vault-plus/media/batch \
--header 'Content-Type: application/json' \
--header 'apiKey: <api-key>' \
--header 'x-connection-id: <x-connection-id>' \
--data '
{
"mediaIds": [
"4492994399",
"4492994400"
]
}
'import requests
url = "https://api.ofauth.com/v2/vault-plus/media/batch"
payload = { "mediaIds": ["4492994399", "4492994400"] }
headers = {
"x-connection-id": "<x-connection-id>",
"apiKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-connection-id': '<x-connection-id>',
apiKey: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({mediaIds: ['4492994399', '4492994400']})
};
fetch('https://api.ofauth.com/v2/vault-plus/media/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ofauth.com/v2/vault-plus/media/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mediaIds' => [
'4492994399',
'4492994400'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apiKey: <api-key>",
"x-connection-id: <x-connection-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ofauth.com/v2/vault-plus/media/batch"
payload := strings.NewReader("{\n \"mediaIds\": [\n \"4492994399\",\n \"4492994400\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-connection-id", "<x-connection-id>")
req.Header.Add("apiKey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ofauth.com/v2/vault-plus/media/batch")
.header("x-connection-id", "<x-connection-id>")
.header("apiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"mediaIds\": [\n \"4492994399\",\n \"4492994400\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ofauth.com/v2/vault-plus/media/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-connection-id"] = '<x-connection-id>'
request["apiKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mediaIds\": [\n \"4492994399\",\n \"4492994400\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "4492994399",
"type": "image",
"duration": null,
"media": {
"full": {
"status": "stored",
"quality": "full",
"sizeBytes": 1024000,
"contentType": "image/jpeg",
"accessCount": 12,
"createdAt": 1715800000000,
"expiresAt": 1715886400000,
"storedAt": 1715800100000,
"lastAccessedAt": 1715800500000,
"url": "https://media.ofauth.com/v2/example-signed-media-url"
},
"thumb": {
"status": "stored",
"quality": "thumb",
"sizeBytes": 32000,
"contentType": "image/jpeg",
"accessCount": 8,
"createdAt": 1715800000000,
"expiresAt": 1715886400000,
"storedAt": 1715800100000,
"lastAccessedAt": 1715800500000,
"url": "https://media.ofauth.com/v2/example-signed-thumbnail-url"
}
}
}
]
}{
"error": "mediaIds must contain 100 or fewer IDs"
}{
"error": "Unauthorized"
}Media
Get multiple media items with all quality variants
Returns cached media items for up to 100 media IDs. This route is registered before /:mediaId so batch is not treated as a media ID.
POST
/
v2
/
vault-plus
/
media
/
batch
Get multiple media items with all quality variants
curl --request POST \
--url https://api.ofauth.com/v2/vault-plus/media/batch \
--header 'Content-Type: application/json' \
--header 'apiKey: <api-key>' \
--header 'x-connection-id: <x-connection-id>' \
--data '
{
"mediaIds": [
"4492994399",
"4492994400"
]
}
'import requests
url = "https://api.ofauth.com/v2/vault-plus/media/batch"
payload = { "mediaIds": ["4492994399", "4492994400"] }
headers = {
"x-connection-id": "<x-connection-id>",
"apiKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-connection-id': '<x-connection-id>',
apiKey: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({mediaIds: ['4492994399', '4492994400']})
};
fetch('https://api.ofauth.com/v2/vault-plus/media/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ofauth.com/v2/vault-plus/media/batch",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mediaIds' => [
'4492994399',
'4492994400'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apiKey: <api-key>",
"x-connection-id: <x-connection-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ofauth.com/v2/vault-plus/media/batch"
payload := strings.NewReader("{\n \"mediaIds\": [\n \"4492994399\",\n \"4492994400\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-connection-id", "<x-connection-id>")
req.Header.Add("apiKey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ofauth.com/v2/vault-plus/media/batch")
.header("x-connection-id", "<x-connection-id>")
.header("apiKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"mediaIds\": [\n \"4492994399\",\n \"4492994400\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ofauth.com/v2/vault-plus/media/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-connection-id"] = '<x-connection-id>'
request["apiKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"mediaIds\": [\n \"4492994399\",\n \"4492994400\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"items": [
{
"id": "4492994399",
"type": "image",
"duration": null,
"media": {
"full": {
"status": "stored",
"quality": "full",
"sizeBytes": 1024000,
"contentType": "image/jpeg",
"accessCount": 12,
"createdAt": 1715800000000,
"expiresAt": 1715886400000,
"storedAt": 1715800100000,
"lastAccessedAt": 1715800500000,
"url": "https://media.ofauth.com/v2/example-signed-media-url"
},
"thumb": {
"status": "stored",
"quality": "thumb",
"sizeBytes": 32000,
"contentType": "image/jpeg",
"accessCount": 8,
"createdAt": 1715800000000,
"expiresAt": 1715886400000,
"storedAt": 1715800100000,
"lastAccessedAt": 1715800500000,
"url": "https://media.ofauth.com/v2/example-signed-thumbnail-url"
}
}
}
]
}{
"error": "mediaIds must contain 100 or fewer IDs"
}{
"error": "Unauthorized"
}Headers
Connection ID whose Vault+ cache should be read or modified.
Minimum string length:
1Example:
"conn_v5bsqkzsjfk8cgr7hqbbw09t"
Body
application/json
Batch media lookup request.
Raw OnlyFans media IDs to fetch. Maximum 100 IDs per request.
Maximum array length:
100Raw OnlyFans media ID.
Example:
["4492994399", "4492994400"]
Response
Found media items with all cached variants. IDs that are not cached are omitted.
Batch media lookup response.
Found media items. Missing IDs are omitted from the response.
Show child attributes
Show child attributes
Was this page helpful?
⌘I