Verifylink.io
  • 🚀Get Started
  • 🎯Account Setup
  • 👩‍💻Start with API
Powered by GitBook
On this page
  • Start Testing
  • Create a request
  • Examples

Was this helpful?

Start with API

Our API is simple to start with, Utilize this api to test your tracking link direcly on your servers, this API is ment for server-to-server, so make sure you don't use this on client side (browser).

PreviousAccount Setup

Last updated 12 months ago

Was this helpful?

Start Testing

Note : You can follow this guide to grab your API Keys, click

Base endpoint : https://verifylink.io

Create a request

POST /api/v1

The request should be a POST with the appropriate headers and body in raw format.

Headers

Name
Required
Value

Content-Type

true

application/json

apiKey

true

xxxxx-xxxxxxx-xxxxxx

Body

Name
Type
Required
Description

url

string

true

https://example.com/offer?id=123

os

string

true

android or ios or desktop

version

string

true

This is OS version, it should be 13 if you want Android 13 or 17.5 if you want IOS 17.5

country

string

true

it should be two-letter country codes of country, for eg : US, GB

state

string

false

This should be state code, for New York, it should be NY

city

string

false

This should be city name in small characters for eg : newyork

zipcode

string

false

This should be valid zip code, for eg : 10013

isScreenshot

boolean

false

This should be either true or false

Note : If you set "isScreenshot" to true, each request will cost 10 credits. Only enable this option if necessary.

Response

{
    "message": "Process completed",
    "redirectUrls": [
        "https://surl.li/twxos",
        "http://surl.li/twxos",
        "https://bitly.cx/AB4W",
        "https://shorturl.at/2E86Q",
        "https://www.shorturl.at/2E86Q",
        "https://verifylink.io/"
    ],
    "screenshots": [],
    "statusCodes": [
        307,
        301,
        301,
        302,
        301,
        302
    ],
    "content": "<!DOCTYPE html><html lang=\"en\" class=\"nprogress-busy\" style=\"\"><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width\"><link rel=\"icon\" type=\"image/png\" href=\"/assets/images/site/favicon.png\"><meta name=\"title\" content=\"verifylink.io\"><meta name=\"description\" content=\"Verfiylink.io is the affiliate link testing application for affiliate marketers to test affiliate links based on various criteria like geolocation, device etc.\"><meta name=\"keywords\" content=\"link testing pla",
    "serverfailure": false,
    "destination": "website"
}
{
    "message": "Missing required parameters"
}

Examples

const https = require('https');

const data = JSON.stringify({
    url: 'https://surl.li/twxos',
    os: 'ios',
    version: '17.5',
    country: 'US'
});

const options = {
    hostname: 'verifylink.io',
    port: 443,
    path: '/api/v1',
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        'apiKey': 'xxxxx-xxxxxxx-xxxxxx'
    }
};

const req = https.request(options, (res) => {
    let responseData = '';

    res.on('data', (chunk) => {
        responseData += chunk;
    });

    res.on('end', () => {
        try {
            const jsonResponse = JSON.parse(responseData);
            console.log('Message:', jsonResponse.message);
            console.log('Redirect URLs:', jsonResponse.redirectUrls);
            console.log('Screenshots:', jsonResponse.screenshots);
            console.log('Status Codes:', jsonResponse.statusCodes);
            console.log('Content:', jsonResponse.content.substring(0, 200) + '...'); // Print first 200 characters
            console.log('Server Failure:', jsonResponse.serverfailure);
            console.log('Destination:', jsonResponse.destination);
        } catch (error) {
            console.error('Error parsing response:', error);
        }
    });
});

req.on('error', (error) => {
    console.error('Error:', error);
});

req.write(data);
req.end();
<?php

$url = 'https://verifylink.io/api/v1';
$apiKey = 'xxxxx-xxxxxxx-xxxxxx';

$data = [
    'url' => 'https://surl.li/twxos',
    'os' => 'ios',
    'version' => '17.5',
    'country' => 'US'
];

$payload = json_encode($data);

$ch = curl_init($url);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
    'apiKey: ' . $apiKey
]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);

$response = curl_exec($ch);

if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
} else {
    $responseData = json_decode($response, true);

    echo 'Message: ' . $responseData['message'] . PHP_EOL;
    echo 'Redirect URLs: ' . implode(', ', $responseData['redirectUrls']) . PHP_EOL;
    echo 'Screenshots: ' . implode(', ', $responseData['screenshots']) . PHP_EOL;
    echo 'Status Codes: ' . implode(', ', $responseData['statusCodes']) . PHP_EOL;
    echo 'Content: ' . substr($responseData['content'], 0, 200) . '...' . PHP_EOL; // Print first 200 characters
    echo 'Server Failure: ' . ($responseData['serverfailure'] ? 'true' : 'false') . PHP_EOL;
    echo 'Destination: ' . $responseData['destination'] . PHP_EOL;
}

curl_close($ch);

?>
import requests
import json

url = 'https://verifylink.io/api/v1'
api_key = 'xxxxx-xxxxxxx-xxxxxx'

data = {
    'url': 'https://surl.li/twxos',
    'os': 'ios',
    'version': '17.5',
    'country': 'US'
}

headers = {
    'Content-Type': 'application/json',
    'apiKey': api_key
}

response = requests.post(url, headers=headers, data=json.dumps(data))

if response.status_code == 200:
    response_data = response.json()
    print('Message:', response_data.get('message'))
    print('Redirect URLs:', response_data.get('redirectUrls', []))
    print('Screenshots:', response_data.get('screenshots', []))
    print('Status Codes:', response_data.get('statusCodes', []))
    print('Content:', response_data.get('content', '')[:200] + '...')  # Print first 200 characters
    print('Server Failure:', response_data.get('serverfailure'))
    print('Destination:', response_data.get('destination'))
else:
    print('Request failed with status code:', response.status_code)
    print('Response:', response.text)
require 'net/http'
require 'json'
require 'uri'

url = URI('https://verifylink.io/api/v1')
api_key = 'xxxxx-xxxxxxx-xxxxxx'

data = {
  url: 'https://surl.li/twxos',
  os: 'ios',
  version: '17.5',
  country: 'US'
}

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url.path, {
  'Content-Type' => 'application/json',
  'apiKey' => api_key
})
request.body = data.to_json

response = http.request(request)

if response.is_a?(Net::HTTPSuccess)
  response_data = JSON.parse(response.body)
  puts "Message: #{response_data['message']}"
  puts "Redirect URLs: #{response_data['redirectUrls'].join(', ')}"
  puts "Screenshots: #{response_data['screenshots'].join(', ')}"
  puts "Status Codes: #{response_data['statusCodes'].join(', ')}"
  puts "Content: #{response_data['content'][0, 200]}..." # Print first 200 characters
  puts "Server Failure: #{response_data['serverfailure']}"
  puts "Destination: #{response_data['destination']}"
else
  puts "Request failed with status code: #{response.code}"
  puts "Response: #{response.body}"
end
const express = require('express');
const axios = require('axios');

const app = express();
const port = 3000;

app.use(express.json());

app.post('/verifylink', async (req, res) => {
    const apiUrl = 'https://verifylink.io/api/v1';
    const apiKey = 'xxxxx-xxxxxxx-xxxxxx';

    const requestData = {
        url: 'https://surl.li/twxos',
        os: 'ios',
        version: '17.5',
        country: 'US'
    };

    try {
        const response = await axios.post(apiUrl, requestData, {
            headers: {
                'Content-Type': 'application/json',
                'apiKey': apiKey
            }
        });

        const responseData = response.data;

        res.json({
            message: responseData.message,
            redirectUrls: responseData.redirectUrls,
            screenshots: responseData.screenshots,
            statusCodes: responseData.statusCodes,
            content: responseData.content.substring(0, 200) + '...', // Print first 200 characters
            serverfailure: responseData.serverfailure,
            destination: responseData.destination
        });
    } catch (error) {
        console.error('Error:', error);
        res.status(500).json({ error: 'An error occurred' });
    }
});

app.listen(port, () => {
    console.log(`Server is running on http://localhost:${port}`);
});

👩‍💻
here