코드 예시

내 IP 요청을 복사하거나 단일 IP용 n8n 워크플로를 가져오세요.

내 IP 요청 예시

모든 예시는 같은 엔드포인트를 호출합니다. 반환되는 IP 주소의 주체는 연결하는 프로세스에 따라 결정됩니다.

네이티브 fetch 및 AbortSignal.timeout을 지원하는 JavaScript 모듈 또는 브라우저 콘솔을 사용하세요.

내 IP 요청
const response = await fetch(
  "https://api.ipquery.io/?format=json",
  { signal: AbortSignal.timeout(5000) }
);
if (!response.ok) {
  const message = await response.text();
  throw new Error("IPQuery " + response.status + ": " + message);
}
const data = await response.json();
console.log(JSON.stringify(data, null, 2));

예시는 5초 시간 제한과 각 언어의 표준 HTTP 도구를 사용합니다. 애플리케이션에서 실패를 처리하세요. 빈 IP 레코드로 대체하지 마세요.

n8n에서 지정한 IP 하나 조회하기

이 JSON을 n8n 편집기에 붙여넣으세요. Set IP에서 8.8.8.8을 IPv4 또는 IPv6 주소 하나로 바꾼 다음 워크플로를 수동으로 실행하세요.

단일 IP용 n8n 워크플로 · n8n 2.46.6
{
  "name": "IPQuery single IP lookup",
  "nodes": [
    {
      "parameters": {},
      "id": "manual-trigger",
      "name": "Run manually",
      "type": "n8n-nodes-base.manualTrigger",
      "typeVersion": 1,
      "position": [
        0,
        0
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "ip-address",
              "name": "ip",
              "value": "8.8.8.8",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "id": "set-ip",
      "name": "Set IP",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.5,
      "position": [
        240,
        0
      ]
    },
    {
      "parameters": {
        "method": "GET",
        "url": "={{ typeof $json.ip === 'string' && /^(?:\\d{1,3}(?:\\.\\d{1,3}){3}|[0-9a-f:.]*:[0-9a-f:.]+)$/i.test($json.ip.trim()) ? 'https://api.ipquery.io/' + encodeURIComponent($json.ip.trim()) + '?format=json' : '' }}",
        "options": {
          "timeout": 8000,
          "response": {
            "response": {
              "responseFormat": "json"
            }
          },
          "redirect": {
            "redirect": {
              "followRedirects": false
            }
          }
        }
      },
      "id": "lookup-ip",
      "name": "Lookup IP",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.5,
      "position": [
        480,
        0
      ]
    }
  ],
  "connections": {
    "Run manually": {
      "main": [
        [
          {
            "node": "Set IP",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set IP": {
      "main": [
        [
          {
            "node": "Lookup IP",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  }
}

이 워크플로는 자격 증명이나 커뮤니티 노드 없이 n8n의 내장 HTTP Request 노드를 사용합니다. Lookup IP는 지정한 주소의 JSON 응답을 요청하며, 일괄 조회는 비활성화되어 있습니다. n8n에서 내 IP 엔드포인트를 호출하면 n8n 서버가 연결에 사용하는 주소가 반환됩니다.

Lookup IP는 2xx 범위 밖의 응답을 받으면 워크플로를 중지합니다. 8000 ms 타임아웃은 응답이 시작될 때까지의 대기 시간만 제한하며 전체 실행 시간은 제한하지 않습니다.

전체 목록 접근.

가격 또는 전체 목록 접근은 다음으로 이메일을 보내 문의하세요: contact@ipquery.io.

선택된 목록
선택된 레코드
이 목록의 레코드