Skip to main content
API v2 is the recommended version of the Greip API. It uses the same dashboard API key and billing as v1, but different base URLs, routes, authentication rules, and JSON shapes. You can run v1 and v2 in parallel while you migrate endpoint by endpoint.
Use the version switcher at the top of these docs to compare API v2 (default) with API v1 (Legacy) reference pages side by side.

Why migrate to v2?

v2 is the default in these docs and the recommended target for new and existing integrations. You keep the same Greip account, API key, plans, and usage limits; you point traffic at https://v2.greipapi.com and update how you authenticate and parse responses.

Response time and observability

v2 is built for low-latency production traffic, including high-volume geo and scoring on checkout, signup, and login flows. Every successful v2 response includes execution_ms, so you can measure Greip processing time per request and compare v1 vs v2 in your own dashboards. Run both versions in staging with mode=test before you cut over.

Richer data for fraud and geo decisions

v2 responses expose more structure and decision-ready fields than the flat v1 geo object:

Clearer, more secure API design

  • Bearer-only authentication keeps keys out of query strings, server access logs, and referrer headers.
  • Path-based resources (/lookup/ip/{ip}, /score/email/{email}) match common REST client patterns and OpenAPI tooling.
  • Consistent JSON: snake_case fields and a boolean success flag make parsing and SDK generation straightforward.

Long-term support

New API improvements and documentation focus on v2. Legacy v1 remains available for existing integrations, but upgrading now avoids a larger migration later and lets you use the latest response fields and routes described in the API Reference. The sections below cover exact URL, auth, and field mappings for your upgrade.

Base URL

All v2 endpoint URLs in the API Reference use the v2 host.

Authentication

Send the same key from your dashboard:
See Authentication for key safety practices.

Request shape

Shared query options (params, lang, format, mode, callback, source, user_id) behave like v1 unless noted on the v2 endpoint page. See Customize response modules and Development environment.

Response envelope

Success and error wrappers differ. Update any code that checks response.status === "success". v2 success example:
v2 error example:
Error codes and types are the same across versions. See Error codes.

Geo and IP lookup data (largest schema change)

v1 returns a flat object (countryCode, continentName, ipType, optional modules at the top level). v2 returns nested objects: Security module (query params=security, response key security): Bulk IP lookup: v2 data is an object whose keys are IP strings; each value has the same shape as a single IP lookup. Free Get-IP: v2 GET /ip returns data.ip metadata (no auth). See the Free Get-IP page.

Scoring and validation endpoints

Use the matching v2 API Reference page for full request and response property lists.

Endpoint map (v1 path to v2)

Migration checklist

1

Pick an endpoint

Start with read-only traffic (for example GeoIP or IP lookup) before payment or deletion APIs.
2

Change base URL and path

Point requests to https://v2.greipapi.com and the v2 path from the table above or API Reference.
3

Move authentication to Bearer

Remove key from query strings and JSON bodies for v2 calls.
4

Use mode=test

Set mode=test while you update parsers; v2 returns deterministic sample data in test mode like v1.
5

Update response parsing

Check success instead of status, read execution_ms, and map nested data fields (geo/security/scoring).
6

Ship gradually

Run v1 and v2 in parallel per route, compare responses in staging, then cut over and remove v1 calls.

What stays the same

  • Same Greip account, API key, plans, usage limits, and custom rules behavior for equivalent endpoints.
  • Same error codes and types (only the success wrapper field name changes on v2).
  • Response formats (JSON, XML, CSV, Newline) and JSONP callback where supported on the endpoint.

Need help?