# Insights

## Table of Contents

- [CLI Microlink API example](#cli-microlink-api-example)
  - [cURL Microlink API example](#curl-microlink-api-example)
  - [JavaScript Microlink API example](#javascript-microlink-api-example)
  - [Python Microlink API example](#python-microlink-api-example)
  - [Ruby Microlink API example](#ruby-microlink-api-example)
  - [PHP Microlink API example](#php-microlink-api-example)
  - [Golang Microlink API example](#golang-microlink-api-example)
- [SDK installation](#sdk-installation)
- [How it works](#how-it-works)
- [Choose a mode](#choose-a-mode)
- [Keep it light](#keep-it-light)
  - [CLI Microlink API example](#cli-microlink-api-example-1)
  - [cURL Microlink API example](#curl-microlink-api-example-1)
  - [JavaScript Microlink API example](#javascript-microlink-api-example-1)
  - [Python Microlink API example](#python-microlink-api-example-1)
  - [Ruby Microlink API example](#ruby-microlink-api-example-1)
  - [PHP Microlink API example](#php-microlink-api-example-1)
  - [Golang Microlink API example](#golang-microlink-api-example-1)
- [Free tier and API key](#free-tier-and-api-key)
- [What's next](#whats-next)
- [See also](#see-also)

---

Running Insights requires two parameters: the target `url` and `insights`.

Use `insights: true` to run both technology detection and a Lighthouse audit, or pass an object when you want only one of them.

The following examples show how to use the Microlink API with CLI, cURL, JavaScript, Python, Ruby, PHP & Golang, targeting 'https://vercel.com' URL with 'insights' & 'meta' API parameters:

### CLI Microlink API example

```bash
microlink https://vercel.com&insights
```

### cURL Microlink API example

```bash
curl -G "https://api.microlink.io" \
  -d "url=https://vercel.com" \
  -d "insights=true" \
  -d "meta=false"
```

### JavaScript Microlink API example

```javascript
import createClient from 'microlink.io'

const microlink = createClient()

const technologies = await microlink.technologies('https://vercel.com')

const report = await microlink.lighthouse('https://vercel.com')
```

### Python Microlink API example

```python
import requests

url = "https://api.microlink.io/"

querystring = {
    "url": "https://vercel.com",
    "insights": "true",
    "meta": "false"
}

response = requests.get(url, params=querystring)

print(response.json())
```

### Ruby Microlink API example

```ruby
require 'uri'
require 'net/http'

base_url = "https://api.microlink.io/"

params = {
  url: "https://vercel.com",
  insights: "true",
  meta: "false"
}

uri = URI(base_url)
uri.query = URI.encode_www_form(params)

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

request = Net::HTTP::Get.new(uri)
response = http.request(request)

puts response.body
```

### PHP Microlink API example

```php
<?php

$baseUrl = "https://api.microlink.io/";

$params = [
    "url" => "https://vercel.com",
    "insights" => "true",
    "meta" => "false"
];

$query = http_build_query($params);
$url = $baseUrl . '?' . $query;

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET"
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
    echo "cURL Error #: " . $err;
} else {
    echo $response;
}
```

### Golang Microlink API example

```
package main

import (
    "fmt"
    "net/http"
    "net/url"
    "io"
)

func main() {
    baseURL := "https://api.microlink.io"

    u, err := url.Parse(baseURL)
    if err != nil {
        panic(err)
    }
    q := u.Query()
    q.Set("url", "https://vercel.com")
    q.Set("insights", "true")
    q.Set("meta", "false")
    u.RawQuery = q.Encode()

    req, err := http.NewRequest("GET", u.String(), nil)
    if err != nil {
        panic(err)
    }

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, err := io.ReadAll(resp.Body)
    if err != nil {
        panic(err)
    }

    fmt.Println(string(body))
}
```

```javascript
importcreateClientfrom'microlink.io'

constmicrolink=createClient()

consttechnologies=awaitmicrolink.technologies('https://vercel.com')

constreport=awaitmicrolink.lighthouse('https://vercel.com')
```

Run the request and look for the analysis under `data.insights`.

## SDK installation

To run the JavaScript examples with the SDK, install `microlink.io`:

```bash
npminstallmicrolink.io--save
```

It works in Node.js, Edge runtimes, and the browser. See the [SDK overview](https://microlink.io/docs/sdk/getting-started/overview) for the environment-specific setup.

If you are using another language, you do not need to install the SDK to follow this guide. You can use the terminal examples or call the API directly from any HTTP client.

## How it works

Switch to an `insights` object when you want only one analysis:

```js
{

url:'https://vercel.com',

insights:{

technologies:true,

lighthouse:false

},

meta:false

}
```

In practice, you will usually read one of these fields:

- `data.insights.technologies`
- `data.insights.lighthouse`

## Choose a mode

| Need                                  | Best option                                           | Why                          |
| ------------------------------------- | ----------------------------------------------------- | ---------------------------- |
| You want to identify the site's stack | `insights: { technologies: true, lighthouse: false }` | Faster and lighter           |
| You want a Lighthouse audit           | `insights: { technologies: false, lighthouse: true }` | Focuses on report generation |
| You want both                         | `insights: true`                                      | Runs the full Insights flow  |

## Keep it light

If Insights is the only thing you need, skip metadata and keep only the Insights payload:

The following examples show how to use the Microlink API with CLI, cURL, JavaScript, Python, Ruby, PHP & Golang, targeting 'https://vercel.com' URL with 'insights', 'meta' & 'filter' API parameters:

### CLI Microlink API example

```bash
microlink https://vercel.com&insights.technologies&filter=insights
```

### cURL Microlink API example

```bash
curl -G "https://api.microlink.io" \
  -d "url=https://vercel.com" \
  -d "insights.technologies=true" \
  -d "insights.lighthouse=false" \
  -d "meta=false" \
  -d "filter=insights"
```

### JavaScript Microlink API example

```javascript
import createClient from 'microlink.io'

const microlink = createClient()

const technologies = await microlink.technologies('https://vercel.com')
```

### Python Microlink API example

```python
import requests

url = "https://api.microlink.io/"

querystring = {
    "url": "https://vercel.com",
    "insights.technologies": "true",
    "insights.lighthouse": "false",
    "meta": "false",
    "filter": "insights"
}

response = requests.get(url, params=querystring)

print(response.json())
```

### Ruby Microlink API example

```ruby
require 'uri'
require 'net/http'

base_url = "https://api.microlink.io/"

params = {
  url: "https://vercel.com",
  insights.technologies: "true",
  insights.lighthouse: "false",
  meta: "false",
  filter: "insights"
}

uri = URI(base_url)
uri.query = URI.encode_www_form(params)

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

request = Net::HTTP::Get.new(uri)
response = http.request(request)

puts response.body
```

### PHP Microlink API example

```php
<?php

$baseUrl = "https://api.microlink.io/";

$params = [
    "url" => "https://vercel.com",
    "insights.technologies" => "true",
    "insights.lighthouse" => "false",
    "meta" => "false",
    "filter" => "insights"
];

$query = http_build_query($params);
$url = $baseUrl . '?' . $query;

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => $url,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET"
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
    echo "cURL Error #: " . $err;
} else {
    echo $response;
}
```

### Golang Microlink API example

```
package main

import (
    "fmt"
    "net/http"
    "net/url"
    "io"
)

func main() {
    baseURL := "https://api.microlink.io"

    u, err := url.Parse(baseURL)
    if err != nil {
        panic(err)
    }
    q := u.Query()
    q.Set("url", "https://vercel.com")
    q.Set("insights.technologies", "true")
    q.Set("insights.lighthouse", "false")
    q.Set("meta", "false")
    q.Set("filter", "insights")
    u.RawQuery = q.Encode()

    req, err := http.NewRequest("GET", u.String(), nil)
    if err != nil {
        panic(err)
    }

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, err := io.ReadAll(resp.Body)
    if err != nil {
        panic(err)
    }

    fmt.Println(string(body))
}
```

```javascript
importcreateClientfrom'microlink.io'

constmicrolink=createClient()

consttechnologies=awaitmicrolink.technologies('https://vercel.com')
```

Use `meta: false` and `filter: 'insights'` to keep the request lighter and the response smaller.

If you run repeated checks, you can also add [ttl](https://microlink.io/docs/api/parameters/ttl)

PRO

or [staleTtl](https://microlink.io/docs/api/parameters/staleTtl)

PRO

to cache expensive runs.

## Free tier and API key

Sign up for a free API key at [dashboard.microlink.io](https://dashboard.microlink.io/signup?from=/docs/guides/insights&product=metadata&cta=docs:content): **25 free requests per day** with every Pro feature, including configurable cache TTL, custom headers, and proxy support. For production volume, a

PRO

plan raises the quota on the same key.

See the [authentication](https://microlink.io/docs/api/basics/authentication) and [rate limit](https://microlink.io/docs/api/basics/rate-limit) docs for details.

## What's next

- **[Technology detection](https://microlink.io/docs/guides/insights/technology-detection)** — identify frameworks, CDNs, analytics tools, and other technologies behind a site.
- **[Lighthouse reports](https://microlink.io/docs/guides/insights/lighthouse-reports)** — generate JSON, HTML, or CSV Lighthouse audits and tune report settings.
- **[Caching and performance](https://microlink.io/docs/guides/insights/caching-and-performance)** — cache expensive runs, skip unnecessary work, and verify response behavior.
- **[Troubleshooting](https://microlink.io/docs/guides/insights/troubleshooting)** — fix missing results, slow requests, private-page issues, and blocked sites.

## See also

- [Metadata](https://microlink.io/docs/guides/metadata) — if you need link preview data alongside site analysis.
- [Screenshot](https://microlink.io/docs/guides/screenshot) — if you want a visual capture of the analyzed site.