---
updatedAt: 2026-02-26T17:17:06.000Z
agentTools:
  projectIndex: https://docs.ipdata.co/llms.txt
---

# Quick Start

ipdata provides a simple HTTP-based API that allows you to look up the location, ownership and threat profile of any IP address.

> 👍 View your API key in the examples
>
> Click "Log In" at the top right corner to enable showing your API key in the code examples.

The simplest call you can make would be a parameter-less GET call to the API endpoint at <https://api.ipdata.co>. This will return the location of the device making the API request.

```curl
curl "https://api.ipdata.co?api-key=<<apiKey>>"
```
```shell httpie
https api.ipdata.co api-key==<<apiKey>>
```
```shell ipdata CLI
ipdata
```

To lookup a specific IP Address, pass the IP address as a path parameter.

```curl
curl "https://api.ipdata.co/8.8.8.8?api-key=<<apiKey>>"
```
```shell httpie
https api.ipdata.co/8.8.8.8 api-key==<<apiKey>>
```
```shell ipdata CLI
ipdata 8.8.8.8
```

We also offer a dedicated EU endpoint <https://eu-api.ipdata.co> to ensure that the end user data you send us stays in the EU. This has the same functionality as our standard endpoint but routes the request through our EU servers (Paris, Ireland and Frankfurt) only.

```curl
curl "https://eu-api.ipdata.co?api-key=<<apiKey>>"
```
```shell httpie
https eu-api.ipdata.co api-key==<<apiKey>>
```
```python
import ipdata

ipdata.api_key = "<YOUR API KEY>"
ipdata.endpoint = "https://eu-api.ipdata.co"

response = ipdata.lookup('69.78.70.144')

print(response)
```

# More Examples

```javascript
var request = new XMLHttpRequest();

request.open('GET', 'https://api.ipdata.co/?api-key=<<apiKey>>');

request.setRequestHeader('Accept', 'application/json');

request.onreadystatechange = function () {
  if (this.readyState === 4) {
    console.log(this.responseText);
  }
};

request.send();
```
```python
import ipdata

ipdata.api_key = "<<apiKey>>"
response = ipdata.lookup('69.78.70.144')
print(response)
```
```javascript Node JS
import IPData from 'ipdata';

const ipdata = new IPData('YOUR_API_KEY');

ipdata.lookup('8.8.8.8')
  .then(data => console.log(data));
```
```php
<?php
require 'vendor/autoload.php';

use Ipdata\ApiClient\Ipdata;
use Symfony\Component\HttpClient\Psr18Client;
use Nyholm\Psr7\Factory\Psr17Factory;

$httpClient = new Psr18Client();
$psr17Factory = new Psr17Factory();
$ipdata = new Ipdata('YOUR_API_KEY', $httpClient, $psr17Factory);

$data = $ipdata->lookup('8.8.8.8');
echo json_encode($data, JSON_PRETTY_PRINT);
```
```ruby
require "ipdata"

client = IPData::Client.new("YOUR_API_KEY")

response = client.lookup("8.8.8.8")

puts response.ip           # => "8.8.8.8"
puts response.city         # => "Mountain View"
puts response.country_name # => "United States"
```
```go
package main

import (
    "fmt"
    "log"
    "github.com/ipdata/go"
)

func main() {
    ipd, _ := ipdata.NewClient("YOUR_API_KEY")
    data, err := ipd.Lookup("8.8.8.8")
    if err != nil {
        log.Fatalf("%v", err)
    }
    fmt.Printf("%s (%s)\n", data.IP, data.ASN)
}
```
```java
import io.ipdata.client.Ipdata;
import io.ipdata.client.model.IpdataModel;
import io.ipdata.client.service.IpdataService;
import java.net.URL;

public class Main {
    public static void main(String[] args) throws Exception {
        URL url = new URL("https://api.ipdata.co");
        IpdataService service = Ipdata.builder()
            .url(url)
            .key("YOUR_API_KEY")
            .get();
        IpdataModel model = service.ipdata("8.8.8.8");
        System.out.println(model);
    }
}
```
```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://api.ipdata.co/?api-key=<<apiKey>>")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```
```rust
use std::error::Error;

fn main() -> Result<(), Box<dyn Error>> {
    let resp = reqwest::blocking::get("https://api.ipdata.co/ip?api-key=<<apiKey>>")?.text()?;
    println!("{:#?}", resp);
    Ok(())
}
```
```typescript
// Import the required library
import fetch from 'node-fetch';

const getIPData = async () => {
    // The URL of the API
    const url = 'https://api.ipdata.co?api-key=<<apiKey>>';

    try {
        // Make the GET request
        const response = await fetch(url);

        // Check if the request was successful
        if (!response.ok) {
            throw new Error('HTTP error ' + response.status);
        }

        // Parse the JSON from the response
        const data = await response.json();

        // Log the data
        console.log(data);
    } catch (error) {
        // Log any errors
        console.log(error);
    }
};

getIPData();

```
```perl
use Net::IPData;

my $ipdata = Net::IPData->new(api_key => 'YOUR_API_KEY');
my $result = $ipdata->lookup('8.8.8.8');
print $result;
```
```csharp
using IpData;

var client = new IpDataClient("YOUR_API_KEY");
var ipInfo = await client.Lookup("8.8.8.8");
Console.WriteLine($"Country: {ipInfo.CountryName}");
```
```erlang
%% Ensure the application is started, then:
{ok, Data} = ipdata:lookup("YOUR_API_KEY", "8.8.8.8"),
  io:format("~p~n", [Data]).

%% Check hexdocs.pm/ipdata for full API docs.
```