GET
/
api
/
whatsmyip
Get Client IP
curl --request GET \
  --url https://onlyautomator.com/api/whatsmyip
{
  "ip": "192.0.2.1",
  "country": "US"
}

Get Client IP

This utility endpoint returns the client’s IP address as seen by the server, potentially enriched with country information from ipinfo.io. It’s useful for testing proxy functionality and verifying that your proxy configuration is working correctly.
Testing Note: When using the ‘Send’ button in this documentation:
  • The IP address returned will likely be that of the server hosting the documentation API, or ::1 / 127.0.0.1 if running locally, not your actual public IP.
  • Geolocation data (country) might not be accurate or available for server/local IPs.
This endpoint currently does not require user authentication, but this might change. For reliable IP detection reflecting your actual connection (or proxy), call this endpoint from your browser or application directly.

Use Cases

  • Proxy Verification: Confirm that your proxy is correctly applied by checking the returned IP
  • Extension Testing: Used by the Chrome extension to verify proxy functionality
  • Debugging: Troubleshoot connectivity issues with proxies
  • IP Rotation Validation: Verify that IP rotation is working as expected

Code Examples

// Using fetch
const getMyIP = async (apiToken) => {
  const response = await fetch('https://onlyautomator.com/api/whatsmyip', {
    headers: {
      'Authorization': `Bearer ${apiToken}`
    }
  });
  
  return await response.json();
};

// Example usage
getMyIP('your_api_token')
  .then(data => console.log(`My current IP is: ${data.ip}`))
  .catch(error => console.error('Error fetching IP:', error));

Chrome Extension Implementation

The OnlyAutomator Chrome extension uses this endpoint to verify that proxies are correctly applied. Here’s how it’s typically used in the extension context:
// Check if proxy is working
async function verifyProxyConnection(apiToken) {
  try {
    // First check without proxy
    const originalResponse = await fetch('https://onlyautomator.com/api/whatsmyip', {
      headers: {
        'Authorization': `Bearer ${apiToken}`
      }
    });
    const originalIP = await originalResponse.json();
    
    // Apply proxy
    await applyProxy();
    
    // Check with proxy
    const proxiedResponse = await fetch('https://onlyautomator.com/api/whatsmyip', {
      headers: {
        'Authorization': `Bearer ${apiToken}`
      }
    });
    const proxiedIP = await proxiedResponse.json();
    
    // Verify IPs are different
    if (originalIP.ip !== proxiedIP.ip) {
      console.log('Proxy successfully applied!');
      return true;
    } else {
      console.warn('Proxy not working - same IP detected');
      return false;
    }
  } catch (error) {
    console.error('Error verifying proxy:', error);
    return false;
  }
}

Notes

  • The IP address is determined from the request headers, primarily using the x-forwarded-for header
  • If your OnlyAutomator instance is behind a proxy or load balancer, the IP reported may be that of the intermediary server
  • For OnlyFans scraping, this endpoint can help confirm that both your browser and the backend scraper are using the same proxy

Response

Client IP address retrieved successfully.

ip
string

The client IP address.

Example:

"192.0.2.1"

country
string | null

The ISO country code based on the IP (if available).

Example:

"US"