Check if a URL already exists
Checks whether a normalized URL already exists in completed URL training data for the current organization.
Checks whether a normalized URL already exists in completed URL training data for the current organization.
GET https://api.weav.com/v1/training-data/url/exists?url=https%3A%2F%2Fwww.example.com%2Fdocs%2F
Requires a token with the external-api:read or external-api:write ability.
Query parameters
urlstringrequiredMaximum length: 2048.
Request
cURL
curl --request GET \
--url 'https://api.weav.com/v1/training-data/url/exists?url=https%3A%2F%2Fwww.example.com%2Fdocs%2F' \
--header "Authorization: Bearer ${WEAV_API_TOKEN}"
JavaScript
const response = await fetch("https://api.weav.com/v1/training-data/url/exists?url=https%3A%2F%2Fwww.example.com%2Fdocs%2F", {
method: "GET",
headers: {
Authorization: `Bearer ${process.env.WEAV_API_TOKEN}`
}
});
console.log(await response.json());
Python
import os
import requests
headers = {"Authorization": f"Bearer {os.environ['WEAV_API_TOKEN']}"}
response = requests.get("https://api.weav.com/v1/training-data/url/exists?url=https%3A%2F%2Fwww.example.com%2Fdocs%2F", headers=headers)
print(response.json())
PHP
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('GET', 'https://api.weav.com/v1/training-data/url/exists?url=https%3A%2F%2Fwww.example.com%2Fdocs%2F', [
'headers' => ['Authorization' => 'Bearer '.getenv('WEAV_API_TOKEN')],
]);
echo $response->getBody();
Response
200 OK
{
"exists": true
}
400 Bad Request
{
"error": "Error message",
"code": "ERROR_CODE",
"errors": {}
}
401Unauthorized
Response fields
existsboolean