/api/link/:name
Added in v1.0
GET
https://api.example.com/api/link/:name
Requires authentication:
X-API-Key: YOUR_API_KEY
Fetch an existing link by the link/URL name.
Headers
-
x-api-keystring requiredAPI key used to authenticate the requestExample:Your actual API key
Path parameters
-
namestring requiredThe name or URL of the link to search forExample:google
Responses
- 200Success
- 404Link not found from name or url.
Request
curl -X GET 'https://api.example.com/api/link/google' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'x-api-key: Your actual API key'
const response = await fetch('https://api.example.com/api/link/google', {
method: 'GET',
headers: {
'X-API-Key': 'YOUR_API_KEY',
'x-api-key': 'Your actual API key',
},
});
const data = await response.json();
console.log(data);
import requests
response = requests.get(
"https://api.example.com/api/link/google",
headers={
"X-API-Key": "YOUR_API_KEY",
"x-api-key": "Your actual API key",
},
)
print(response.json())
<?php
$ch = curl_init('https://api.example.com/api/link/google');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-API-Key: YOUR_API_KEY',
'x-api-key: Your actual API key',
],
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($response);
Response
Success
{
"id": 1,
"name": "google",
"url": "https://google.com",
"count": 0,
"creator": "API",
"creatorID": "0",
"createdAt": "1720000000000"
}
Link not found from name or url.
{
"msg": "Link not found from name or url."
}