HAR File Performance Analyzer
curl --request POST \
--url https://api.iotools.cloud/v1/tool/har-file-performance-analyzer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"harInput": "{\n \"log\": {\n \"version\": \"1.2\",\n \"entries\": [\n {\n \"time\": 220,\n \"request\": {\n \"method\": \"GET\",\n \"url\": \"https://example.com/\"\n },\n \"response\": {\n \"status\": 200,\n \"content\": {\n \"size\": 1256,\n \"mimeType\": \"text/html\"\n },\n \"bodySize\": 1256,\n \"headersSize\": 180\n },\n \"timings\": {\n \"blocked\": 5,\n \"dns\": 12,\n \"connect\": 30,\n \"ssl\": 18,\n \"send\": 1,\n \"wait\": 150,\n \"receive\": 22\n }\n },\n {\n \"time\": 95,\n \"request\": {\n \"method\": \"GET\",\n \"url\": \"https://example.com/assets/app.css\"\n },\n \"response\": {\n \"status\": 200,\n \"content\": {\n \"size\": 4321,\n \"mimeType\": \"text/css\"\n },\n \"bodySize\": 4321,\n \"headersSize\": 140\n },\n \"timings\": {\n \"blocked\": 1,\n \"dns\": 0,\n \"connect\": 0,\n \"ssl\": 0,\n \"send\": 0,\n \"wait\": 70,\n \"receive\": 24\n }\n },\n {\n \"time\": 950,\n \"request\": {\n \"method\": \"GET\",\n \"url\": \"https://cdn.example.com/lib.js\"\n },\n \"response\": {\n \"status\": 200,\n \"content\": {\n \"size\": 89000,\n \"mimeType\": \"application/javascript\"\n },\n \"bodySize\": 89000,\n \"headersSize\": 150\n },\n \"timings\": {\n \"blocked\": 2,\n \"dns\": 18,\n \"connect\": 25,\n \"ssl\": 20,\n \"send\": 0,\n \"wait\": 860,\n \"receive\": 25\n }\n },\n {\n \"time\": 320,\n \"request\": {\n \"method\": \"POST\",\n \"url\": \"https://api.example.com/v1/orders\"\n },\n \"response\": {\n \"status\": 201,\n \"content\": {\n \"size\": 142,\n \"mimeType\": \"application/json\"\n },\n \"bodySize\": 142,\n \"headersSize\": 130\n },\n \"timings\": {\n \"blocked\": 1,\n \"dns\": 8,\n \"connect\": 22,\n \"ssl\": 18,\n \"send\": 1,\n \"wait\": 240,\n \"receive\": 30\n }\n },\n {\n \"time\": 80,\n \"request\": {\n \"method\": \"GET\",\n \"url\": \"https://api.example.com/v1/missing\"\n },\n \"response\": {\n \"status\": 404,\n \"content\": {\n \"size\": 35,\n \"mimeType\": \"application/json\"\n },\n \"bodySize\": 35,\n \"headersSize\": 110\n },\n \"timings\": {\n \"blocked\": 1,\n \"dns\": 0,\n \"connect\": 0,\n \"ssl\": 0,\n \"send\": 0,\n \"wait\": 70,\n \"receive\": 9\n }\n }\n ]\n }\n}",
"filterType": "any",
"filterStatus": "any",
"topN": "10"
}
'import requests
url = "https://api.iotools.cloud/v1/tool/har-file-performance-analyzer"
payload = {
"harInput": "{
\"log\": {
\"version\": \"1.2\",
\"entries\": [
{
\"time\": 220,
\"request\": {
\"method\": \"GET\",
\"url\": \"https://example.com/\"
},
\"response\": {
\"status\": 200,
\"content\": {
\"size\": 1256,
\"mimeType\": \"text/html\"
},
\"bodySize\": 1256,
\"headersSize\": 180
},
\"timings\": {
\"blocked\": 5,
\"dns\": 12,
\"connect\": 30,
\"ssl\": 18,
\"send\": 1,
\"wait\": 150,
\"receive\": 22
}
},
{
\"time\": 95,
\"request\": {
\"method\": \"GET\",
\"url\": \"https://example.com/assets/app.css\"
},
\"response\": {
\"status\": 200,
\"content\": {
\"size\": 4321,
\"mimeType\": \"text/css\"
},
\"bodySize\": 4321,
\"headersSize\": 140
},
\"timings\": {
\"blocked\": 1,
\"dns\": 0,
\"connect\": 0,
\"ssl\": 0,
\"send\": 0,
\"wait\": 70,
\"receive\": 24
}
},
{
\"time\": 950,
\"request\": {
\"method\": \"GET\",
\"url\": \"https://cdn.example.com/lib.js\"
},
\"response\": {
\"status\": 200,
\"content\": {
\"size\": 89000,
\"mimeType\": \"application/javascript\"
},
\"bodySize\": 89000,
\"headersSize\": 150
},
\"timings\": {
\"blocked\": 2,
\"dns\": 18,
\"connect\": 25,
\"ssl\": 20,
\"send\": 0,
\"wait\": 860,
\"receive\": 25
}
},
{
\"time\": 320,
\"request\": {
\"method\": \"POST\",
\"url\": \"https://api.example.com/v1/orders\"
},
\"response\": {
\"status\": 201,
\"content\": {
\"size\": 142,
\"mimeType\": \"application/json\"
},
\"bodySize\": 142,
\"headersSize\": 130
},
\"timings\": {
\"blocked\": 1,
\"dns\": 8,
\"connect\": 22,
\"ssl\": 18,
\"send\": 1,
\"wait\": 240,
\"receive\": 30
}
},
{
\"time\": 80,
\"request\": {
\"method\": \"GET\",
\"url\": \"https://api.example.com/v1/missing\"
},
\"response\": {
\"status\": 404,
\"content\": {
\"size\": 35,
\"mimeType\": \"application/json\"
},
\"bodySize\": 35,
\"headersSize\": 110
},
\"timings\": {
\"blocked\": 1,
\"dns\": 0,
\"connect\": 0,
\"ssl\": 0,
\"send\": 0,
\"wait\": 70,
\"receive\": 9
}
}
]
}
}",
"filterType": "any",
"filterStatus": "any",
"topN": "10"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
harInput: '{\n "log": {\n "version": "1.2",\n "entries": [\n {\n "time": 220,\n "request": {\n "method": "GET",\n "url": "https://example.com/"\n },\n "response": {\n "status": 200,\n "content": {\n "size": 1256,\n "mimeType": "text/html"\n },\n "bodySize": 1256,\n "headersSize": 180\n },\n "timings": {\n "blocked": 5,\n "dns": 12,\n "connect": 30,\n "ssl": 18,\n "send": 1,\n "wait": 150,\n "receive": 22\n }\n },\n {\n "time": 95,\n "request": {\n "method": "GET",\n "url": "https://example.com/assets/app.css"\n },\n "response": {\n "status": 200,\n "content": {\n "size": 4321,\n "mimeType": "text/css"\n },\n "bodySize": 4321,\n "headersSize": 140\n },\n "timings": {\n "blocked": 1,\n "dns": 0,\n "connect": 0,\n "ssl": 0,\n "send": 0,\n "wait": 70,\n "receive": 24\n }\n },\n {\n "time": 950,\n "request": {\n "method": "GET",\n "url": "https://cdn.example.com/lib.js"\n },\n "response": {\n "status": 200,\n "content": {\n "size": 89000,\n "mimeType": "application/javascript"\n },\n "bodySize": 89000,\n "headersSize": 150\n },\n "timings": {\n "blocked": 2,\n "dns": 18,\n "connect": 25,\n "ssl": 20,\n "send": 0,\n "wait": 860,\n "receive": 25\n }\n },\n {\n "time": 320,\n "request": {\n "method": "POST",\n "url": "https://api.example.com/v1/orders"\n },\n "response": {\n "status": 201,\n "content": {\n "size": 142,\n "mimeType": "application/json"\n },\n "bodySize": 142,\n "headersSize": 130\n },\n "timings": {\n "blocked": 1,\n "dns": 8,\n "connect": 22,\n "ssl": 18,\n "send": 1,\n "wait": 240,\n "receive": 30\n }\n },\n {\n "time": 80,\n "request": {\n "method": "GET",\n "url": "https://api.example.com/v1/missing"\n },\n "response": {\n "status": 404,\n "content": {\n "size": 35,\n "mimeType": "application/json"\n },\n "bodySize": 35,\n "headersSize": 110\n },\n "timings": {\n "blocked": 1,\n "dns": 0,\n "connect": 0,\n "ssl": 0,\n "send": 0,\n "wait": 70,\n "receive": 9\n }\n }\n ]\n }\n}',
filterType: 'any',
filterStatus: 'any',
topN: '10'
})
};
fetch('https://api.iotools.cloud/v1/tool/har-file-performance-analyzer', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.iotools.cloud/v1/tool/har-file-performance-analyzer",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'harInput' => '{
"log": {
"version": "1.2",
"entries": [
{
"time": 220,
"request": {
"method": "GET",
"url": "https://example.com/"
},
"response": {
"status": 200,
"content": {
"size": 1256,
"mimeType": "text/html"
},
"bodySize": 1256,
"headersSize": 180
},
"timings": {
"blocked": 5,
"dns": 12,
"connect": 30,
"ssl": 18,
"send": 1,
"wait": 150,
"receive": 22
}
},
{
"time": 95,
"request": {
"method": "GET",
"url": "https://example.com/assets/app.css"
},
"response": {
"status": 200,
"content": {
"size": 4321,
"mimeType": "text/css"
},
"bodySize": 4321,
"headersSize": 140
},
"timings": {
"blocked": 1,
"dns": 0,
"connect": 0,
"ssl": 0,
"send": 0,
"wait": 70,
"receive": 24
}
},
{
"time": 950,
"request": {
"method": "GET",
"url": "https://cdn.example.com/lib.js"
},
"response": {
"status": 200,
"content": {
"size": 89000,
"mimeType": "application/javascript"
},
"bodySize": 89000,
"headersSize": 150
},
"timings": {
"blocked": 2,
"dns": 18,
"connect": 25,
"ssl": 20,
"send": 0,
"wait": 860,
"receive": 25
}
},
{
"time": 320,
"request": {
"method": "POST",
"url": "https://api.example.com/v1/orders"
},
"response": {
"status": 201,
"content": {
"size": 142,
"mimeType": "application/json"
},
"bodySize": 142,
"headersSize": 130
},
"timings": {
"blocked": 1,
"dns": 8,
"connect": 22,
"ssl": 18,
"send": 1,
"wait": 240,
"receive": 30
}
},
{
"time": 80,
"request": {
"method": "GET",
"url": "https://api.example.com/v1/missing"
},
"response": {
"status": 404,
"content": {
"size": 35,
"mimeType": "application/json"
},
"bodySize": 35,
"headersSize": 110
},
"timings": {
"blocked": 1,
"dns": 0,
"connect": 0,
"ssl": 0,
"send": 0,
"wait": 70,
"receive": 9
}
}
]
}
}',
'filterType' => 'any',
'filterStatus' => 'any',
'topN' => '10'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.iotools.cloud/v1/tool/har-file-performance-analyzer"
payload := strings.NewReader("{\n \"harInput\": \"{\\n \\\"log\\\": {\\n \\\"version\\\": \\\"1.2\\\",\\n \\\"entries\\\": [\\n {\\n \\\"time\\\": 220,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"GET\\\",\\n \\\"url\\\": \\\"https://example.com/\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 200,\\n \\\"content\\\": {\\n \\\"size\\\": 1256,\\n \\\"mimeType\\\": \\\"text/html\\\"\\n },\\n \\\"bodySize\\\": 1256,\\n \\\"headersSize\\\": 180\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 5,\\n \\\"dns\\\": 12,\\n \\\"connect\\\": 30,\\n \\\"ssl\\\": 18,\\n \\\"send\\\": 1,\\n \\\"wait\\\": 150,\\n \\\"receive\\\": 22\\n }\\n },\\n {\\n \\\"time\\\": 95,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"GET\\\",\\n \\\"url\\\": \\\"https://example.com/assets/app.css\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 200,\\n \\\"content\\\": {\\n \\\"size\\\": 4321,\\n \\\"mimeType\\\": \\\"text/css\\\"\\n },\\n \\\"bodySize\\\": 4321,\\n \\\"headersSize\\\": 140\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 1,\\n \\\"dns\\\": 0,\\n \\\"connect\\\": 0,\\n \\\"ssl\\\": 0,\\n \\\"send\\\": 0,\\n \\\"wait\\\": 70,\\n \\\"receive\\\": 24\\n }\\n },\\n {\\n \\\"time\\\": 950,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"GET\\\",\\n \\\"url\\\": \\\"https://cdn.example.com/lib.js\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 200,\\n \\\"content\\\": {\\n \\\"size\\\": 89000,\\n \\\"mimeType\\\": \\\"application/javascript\\\"\\n },\\n \\\"bodySize\\\": 89000,\\n \\\"headersSize\\\": 150\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 2,\\n \\\"dns\\\": 18,\\n \\\"connect\\\": 25,\\n \\\"ssl\\\": 20,\\n \\\"send\\\": 0,\\n \\\"wait\\\": 860,\\n \\\"receive\\\": 25\\n }\\n },\\n {\\n \\\"time\\\": 320,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"POST\\\",\\n \\\"url\\\": \\\"https://api.example.com/v1/orders\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 201,\\n \\\"content\\\": {\\n \\\"size\\\": 142,\\n \\\"mimeType\\\": \\\"application/json\\\"\\n },\\n \\\"bodySize\\\": 142,\\n \\\"headersSize\\\": 130\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 1,\\n \\\"dns\\\": 8,\\n \\\"connect\\\": 22,\\n \\\"ssl\\\": 18,\\n \\\"send\\\": 1,\\n \\\"wait\\\": 240,\\n \\\"receive\\\": 30\\n }\\n },\\n {\\n \\\"time\\\": 80,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"GET\\\",\\n \\\"url\\\": \\\"https://api.example.com/v1/missing\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 404,\\n \\\"content\\\": {\\n \\\"size\\\": 35,\\n \\\"mimeType\\\": \\\"application/json\\\"\\n },\\n \\\"bodySize\\\": 35,\\n \\\"headersSize\\\": 110\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 1,\\n \\\"dns\\\": 0,\\n \\\"connect\\\": 0,\\n \\\"ssl\\\": 0,\\n \\\"send\\\": 0,\\n \\\"wait\\\": 70,\\n \\\"receive\\\": 9\\n }\\n }\\n ]\\n }\\n}\",\n \"filterType\": \"any\",\n \"filterStatus\": \"any\",\n \"topN\": \"10\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.iotools.cloud/v1/tool/har-file-performance-analyzer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"harInput\": \"{\\n \\\"log\\\": {\\n \\\"version\\\": \\\"1.2\\\",\\n \\\"entries\\\": [\\n {\\n \\\"time\\\": 220,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"GET\\\",\\n \\\"url\\\": \\\"https://example.com/\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 200,\\n \\\"content\\\": {\\n \\\"size\\\": 1256,\\n \\\"mimeType\\\": \\\"text/html\\\"\\n },\\n \\\"bodySize\\\": 1256,\\n \\\"headersSize\\\": 180\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 5,\\n \\\"dns\\\": 12,\\n \\\"connect\\\": 30,\\n \\\"ssl\\\": 18,\\n \\\"send\\\": 1,\\n \\\"wait\\\": 150,\\n \\\"receive\\\": 22\\n }\\n },\\n {\\n \\\"time\\\": 95,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"GET\\\",\\n \\\"url\\\": \\\"https://example.com/assets/app.css\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 200,\\n \\\"content\\\": {\\n \\\"size\\\": 4321,\\n \\\"mimeType\\\": \\\"text/css\\\"\\n },\\n \\\"bodySize\\\": 4321,\\n \\\"headersSize\\\": 140\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 1,\\n \\\"dns\\\": 0,\\n \\\"connect\\\": 0,\\n \\\"ssl\\\": 0,\\n \\\"send\\\": 0,\\n \\\"wait\\\": 70,\\n \\\"receive\\\": 24\\n }\\n },\\n {\\n \\\"time\\\": 950,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"GET\\\",\\n \\\"url\\\": \\\"https://cdn.example.com/lib.js\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 200,\\n \\\"content\\\": {\\n \\\"size\\\": 89000,\\n \\\"mimeType\\\": \\\"application/javascript\\\"\\n },\\n \\\"bodySize\\\": 89000,\\n \\\"headersSize\\\": 150\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 2,\\n \\\"dns\\\": 18,\\n \\\"connect\\\": 25,\\n \\\"ssl\\\": 20,\\n \\\"send\\\": 0,\\n \\\"wait\\\": 860,\\n \\\"receive\\\": 25\\n }\\n },\\n {\\n \\\"time\\\": 320,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"POST\\\",\\n \\\"url\\\": \\\"https://api.example.com/v1/orders\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 201,\\n \\\"content\\\": {\\n \\\"size\\\": 142,\\n \\\"mimeType\\\": \\\"application/json\\\"\\n },\\n \\\"bodySize\\\": 142,\\n \\\"headersSize\\\": 130\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 1,\\n \\\"dns\\\": 8,\\n \\\"connect\\\": 22,\\n \\\"ssl\\\": 18,\\n \\\"send\\\": 1,\\n \\\"wait\\\": 240,\\n \\\"receive\\\": 30\\n }\\n },\\n {\\n \\\"time\\\": 80,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"GET\\\",\\n \\\"url\\\": \\\"https://api.example.com/v1/missing\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 404,\\n \\\"content\\\": {\\n \\\"size\\\": 35,\\n \\\"mimeType\\\": \\\"application/json\\\"\\n },\\n \\\"bodySize\\\": 35,\\n \\\"headersSize\\\": 110\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 1,\\n \\\"dns\\\": 0,\\n \\\"connect\\\": 0,\\n \\\"ssl\\\": 0,\\n \\\"send\\\": 0,\\n \\\"wait\\\": 70,\\n \\\"receive\\\": 9\\n }\\n }\\n ]\\n }\\n}\",\n \"filterType\": \"any\",\n \"filterStatus\": \"any\",\n \"topN\": \"10\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.iotools.cloud/v1/tool/har-file-performance-analyzer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"harInput\": \"{\\n \\\"log\\\": {\\n \\\"version\\\": \\\"1.2\\\",\\n \\\"entries\\\": [\\n {\\n \\\"time\\\": 220,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"GET\\\",\\n \\\"url\\\": \\\"https://example.com/\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 200,\\n \\\"content\\\": {\\n \\\"size\\\": 1256,\\n \\\"mimeType\\\": \\\"text/html\\\"\\n },\\n \\\"bodySize\\\": 1256,\\n \\\"headersSize\\\": 180\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 5,\\n \\\"dns\\\": 12,\\n \\\"connect\\\": 30,\\n \\\"ssl\\\": 18,\\n \\\"send\\\": 1,\\n \\\"wait\\\": 150,\\n \\\"receive\\\": 22\\n }\\n },\\n {\\n \\\"time\\\": 95,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"GET\\\",\\n \\\"url\\\": \\\"https://example.com/assets/app.css\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 200,\\n \\\"content\\\": {\\n \\\"size\\\": 4321,\\n \\\"mimeType\\\": \\\"text/css\\\"\\n },\\n \\\"bodySize\\\": 4321,\\n \\\"headersSize\\\": 140\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 1,\\n \\\"dns\\\": 0,\\n \\\"connect\\\": 0,\\n \\\"ssl\\\": 0,\\n \\\"send\\\": 0,\\n \\\"wait\\\": 70,\\n \\\"receive\\\": 24\\n }\\n },\\n {\\n \\\"time\\\": 950,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"GET\\\",\\n \\\"url\\\": \\\"https://cdn.example.com/lib.js\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 200,\\n \\\"content\\\": {\\n \\\"size\\\": 89000,\\n \\\"mimeType\\\": \\\"application/javascript\\\"\\n },\\n \\\"bodySize\\\": 89000,\\n \\\"headersSize\\\": 150\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 2,\\n \\\"dns\\\": 18,\\n \\\"connect\\\": 25,\\n \\\"ssl\\\": 20,\\n \\\"send\\\": 0,\\n \\\"wait\\\": 860,\\n \\\"receive\\\": 25\\n }\\n },\\n {\\n \\\"time\\\": 320,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"POST\\\",\\n \\\"url\\\": \\\"https://api.example.com/v1/orders\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 201,\\n \\\"content\\\": {\\n \\\"size\\\": 142,\\n \\\"mimeType\\\": \\\"application/json\\\"\\n },\\n \\\"bodySize\\\": 142,\\n \\\"headersSize\\\": 130\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 1,\\n \\\"dns\\\": 8,\\n \\\"connect\\\": 22,\\n \\\"ssl\\\": 18,\\n \\\"send\\\": 1,\\n \\\"wait\\\": 240,\\n \\\"receive\\\": 30\\n }\\n },\\n {\\n \\\"time\\\": 80,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"GET\\\",\\n \\\"url\\\": \\\"https://api.example.com/v1/missing\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 404,\\n \\\"content\\\": {\\n \\\"size\\\": 35,\\n \\\"mimeType\\\": \\\"application/json\\\"\\n },\\n \\\"bodySize\\\": 35,\\n \\\"headersSize\\\": 110\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 1,\\n \\\"dns\\\": 0,\\n \\\"connect\\\": 0,\\n \\\"ssl\\\": 0,\\n \\\"send\\\": 0,\\n \\\"wait\\\": 70,\\n \\\"receive\\\": 9\\n }\\n }\\n ]\\n }\\n}\",\n \"filterType\": \"any\",\n \"filterStatus\": \"any\",\n \"topN\": \"10\"\n}"
response = http.request(request)
puts response.read_body{
"tool": "har-file-performance-analyzer",
"tool_version": "1.0.1",
"outputs": {
"summary": [
{
"metric": "Total Requests",
"value": "5"
},
{
"metric": "Transfer Size",
"value": "93.23 KB"
},
{
"metric": "Content Size",
"value": "92.53 KB"
},
{
"metric": "Average Time",
"value": "333 ms"
},
{
"metric": "Median Time",
"value": "220 ms"
},
{
"metric": "P90 Time",
"value": "698 ms"
},
{
"metric": "Average TTFB",
"value": "278 ms"
},
{
"metric": "OK / Redirect / Error",
"value": "4 / 0 / 1"
},
{
"metric": "Unique Domains",
"value": "3"
}
],
"byType": [
{
"type": "script",
"requests": "1",
"transfer": "87.06 KB"
},
{
"type": "stylesheet",
"requests": "1",
"transfer": "4.36 KB"
},
{
"type": "document",
"requests": "1",
"transfer": "1.40 KB"
},
{
"type": "xhr",
"requests": "2",
"transfer": "417 B"
}
],
"byDomain": [
{
"domain": "example.com",
"requests": "2",
"transfer": "5.76 KB",
"slowest-request": "220 ms"
},
{
"domain": "api.example.com",
"requests": "2",
"transfer": "417 B",
"slowest-request": "320 ms"
},
{
"domain": "cdn.example.com",
"requests": "1",
"transfer": "87.06 KB",
"slowest-request": "950 ms"
}
],
"slowest": [
{
"url": "https://cdn.example.com/lib.js",
"time": "950 ms",
"status": "200"
},
{
"url": "https://api.example.com/v1/orders",
"time": "320 ms",
"status": "201"
},
{
"url": "https://example.com/",
"time": "220 ms",
"status": "200"
},
{
"url": "https://example.com/assets/app.css",
"time": "95 ms",
"status": "200"
},
{
"url": "https://api.example.com/v1/missing",
"time": "80 ms",
"status": "404"
}
],
"largest": [
{
"url": "https://cdn.example.com/lib.js",
"transfer-size": "87.06 KB",
"status": "200"
},
{
"url": "https://example.com/assets/app.css",
"transfer-size": "4.36 KB",
"status": "200"
},
{
"url": "https://example.com/",
"transfer-size": "1.40 KB",
"status": "200"
},
{
"url": "https://api.example.com/v1/orders",
"transfer-size": "272 B",
"status": "201"
},
{
"url": "https://api.example.com/v1/missing",
"transfer-size": "145 B",
"status": "404"
}
]
},
"credits_used": 3,
"credits_remaining": null
}{
"type": "https://iotools.cloud/docs/errors/validation_error",
"title": "Invalid request",
"status": 400,
"code": "validation_error",
"detail": "One or more inputs are invalid — see `fields`.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11",
"fields": {
"inputString": "Required"
}
}{
"type": "https://iotools.cloud/docs/errors/invalid_api_key",
"title": "Invalid API key",
"status": 401,
"code": "invalid_api_key",
"detail": "Provide 'Authorization: Bearer <key>'.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11"
}{
"type": "https://iotools.cloud/docs/errors/insufficient_credits",
"title": "Insufficient credits",
"status": 402,
"code": "insufficient_credits",
"detail": "This call costs 1 credit and 0 remain in this month's allowance.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11",
"credits_used": 0,
"credits_remaining": 0
}{
"type": "https://iotools.cloud/docs/errors/tool_not_allowed",
"title": "Tool not available over the API",
"status": 403,
"code": "tool_not_allowed",
"detail": "\"Background Remover\" is available on iotools.cloud but has no API endpoint.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11"
}{
"type": "https://iotools.cloud/docs/errors/tool_not_found",
"title": "Tool not found",
"status": 404,
"code": "tool_not_found",
"detail": "No tool with that slug. See GET /v1/tools/list.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11"
}{
"type": "https://iotools.cloud/docs/errors/payload_too_large",
"title": "Payload too large",
"status": 413,
"code": "payload_too_large",
"detail": "Request body exceeds this tool's size limit.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11"
}{
"type": "https://iotools.cloud/docs/errors/rate_limited",
"title": "Rate limit exceeded",
"status": 429,
"code": "rate_limited",
"detail": "Too many requests. Retry in 30s.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11",
"retry_after": 30
}{
"type": "https://iotools.cloud/docs/errors/processing_error",
"title": "Tool failed to run",
"status": 500,
"code": "processing_error",
"detail": "The tool failed to run. Please try again.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11",
"credits_used": 0
}{
"type": "https://iotools.cloud/docs/errors/tool_disabled",
"title": "Tool temporarily disabled",
"status": 503,
"code": "tool_disabled",
"detail": "This tool is temporarily unavailable. Try again shortly.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11"
}Utilities
HAR File Performance Analyzer
Analyze a HAR (HTTP Archive) file’s performance — total/median/p90 load time, TTFB, status/type/domain breakdowns, and the slowest and largest requests.
POST
/
v1
/
tool
/
har-file-performance-analyzer
HAR File Performance Analyzer
curl --request POST \
--url https://api.iotools.cloud/v1/tool/har-file-performance-analyzer \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"harInput": "{\n \"log\": {\n \"version\": \"1.2\",\n \"entries\": [\n {\n \"time\": 220,\n \"request\": {\n \"method\": \"GET\",\n \"url\": \"https://example.com/\"\n },\n \"response\": {\n \"status\": 200,\n \"content\": {\n \"size\": 1256,\n \"mimeType\": \"text/html\"\n },\n \"bodySize\": 1256,\n \"headersSize\": 180\n },\n \"timings\": {\n \"blocked\": 5,\n \"dns\": 12,\n \"connect\": 30,\n \"ssl\": 18,\n \"send\": 1,\n \"wait\": 150,\n \"receive\": 22\n }\n },\n {\n \"time\": 95,\n \"request\": {\n \"method\": \"GET\",\n \"url\": \"https://example.com/assets/app.css\"\n },\n \"response\": {\n \"status\": 200,\n \"content\": {\n \"size\": 4321,\n \"mimeType\": \"text/css\"\n },\n \"bodySize\": 4321,\n \"headersSize\": 140\n },\n \"timings\": {\n \"blocked\": 1,\n \"dns\": 0,\n \"connect\": 0,\n \"ssl\": 0,\n \"send\": 0,\n \"wait\": 70,\n \"receive\": 24\n }\n },\n {\n \"time\": 950,\n \"request\": {\n \"method\": \"GET\",\n \"url\": \"https://cdn.example.com/lib.js\"\n },\n \"response\": {\n \"status\": 200,\n \"content\": {\n \"size\": 89000,\n \"mimeType\": \"application/javascript\"\n },\n \"bodySize\": 89000,\n \"headersSize\": 150\n },\n \"timings\": {\n \"blocked\": 2,\n \"dns\": 18,\n \"connect\": 25,\n \"ssl\": 20,\n \"send\": 0,\n \"wait\": 860,\n \"receive\": 25\n }\n },\n {\n \"time\": 320,\n \"request\": {\n \"method\": \"POST\",\n \"url\": \"https://api.example.com/v1/orders\"\n },\n \"response\": {\n \"status\": 201,\n \"content\": {\n \"size\": 142,\n \"mimeType\": \"application/json\"\n },\n \"bodySize\": 142,\n \"headersSize\": 130\n },\n \"timings\": {\n \"blocked\": 1,\n \"dns\": 8,\n \"connect\": 22,\n \"ssl\": 18,\n \"send\": 1,\n \"wait\": 240,\n \"receive\": 30\n }\n },\n {\n \"time\": 80,\n \"request\": {\n \"method\": \"GET\",\n \"url\": \"https://api.example.com/v1/missing\"\n },\n \"response\": {\n \"status\": 404,\n \"content\": {\n \"size\": 35,\n \"mimeType\": \"application/json\"\n },\n \"bodySize\": 35,\n \"headersSize\": 110\n },\n \"timings\": {\n \"blocked\": 1,\n \"dns\": 0,\n \"connect\": 0,\n \"ssl\": 0,\n \"send\": 0,\n \"wait\": 70,\n \"receive\": 9\n }\n }\n ]\n }\n}",
"filterType": "any",
"filterStatus": "any",
"topN": "10"
}
'import requests
url = "https://api.iotools.cloud/v1/tool/har-file-performance-analyzer"
payload = {
"harInput": "{
\"log\": {
\"version\": \"1.2\",
\"entries\": [
{
\"time\": 220,
\"request\": {
\"method\": \"GET\",
\"url\": \"https://example.com/\"
},
\"response\": {
\"status\": 200,
\"content\": {
\"size\": 1256,
\"mimeType\": \"text/html\"
},
\"bodySize\": 1256,
\"headersSize\": 180
},
\"timings\": {
\"blocked\": 5,
\"dns\": 12,
\"connect\": 30,
\"ssl\": 18,
\"send\": 1,
\"wait\": 150,
\"receive\": 22
}
},
{
\"time\": 95,
\"request\": {
\"method\": \"GET\",
\"url\": \"https://example.com/assets/app.css\"
},
\"response\": {
\"status\": 200,
\"content\": {
\"size\": 4321,
\"mimeType\": \"text/css\"
},
\"bodySize\": 4321,
\"headersSize\": 140
},
\"timings\": {
\"blocked\": 1,
\"dns\": 0,
\"connect\": 0,
\"ssl\": 0,
\"send\": 0,
\"wait\": 70,
\"receive\": 24
}
},
{
\"time\": 950,
\"request\": {
\"method\": \"GET\",
\"url\": \"https://cdn.example.com/lib.js\"
},
\"response\": {
\"status\": 200,
\"content\": {
\"size\": 89000,
\"mimeType\": \"application/javascript\"
},
\"bodySize\": 89000,
\"headersSize\": 150
},
\"timings\": {
\"blocked\": 2,
\"dns\": 18,
\"connect\": 25,
\"ssl\": 20,
\"send\": 0,
\"wait\": 860,
\"receive\": 25
}
},
{
\"time\": 320,
\"request\": {
\"method\": \"POST\",
\"url\": \"https://api.example.com/v1/orders\"
},
\"response\": {
\"status\": 201,
\"content\": {
\"size\": 142,
\"mimeType\": \"application/json\"
},
\"bodySize\": 142,
\"headersSize\": 130
},
\"timings\": {
\"blocked\": 1,
\"dns\": 8,
\"connect\": 22,
\"ssl\": 18,
\"send\": 1,
\"wait\": 240,
\"receive\": 30
}
},
{
\"time\": 80,
\"request\": {
\"method\": \"GET\",
\"url\": \"https://api.example.com/v1/missing\"
},
\"response\": {
\"status\": 404,
\"content\": {
\"size\": 35,
\"mimeType\": \"application/json\"
},
\"bodySize\": 35,
\"headersSize\": 110
},
\"timings\": {
\"blocked\": 1,
\"dns\": 0,
\"connect\": 0,
\"ssl\": 0,
\"send\": 0,
\"wait\": 70,
\"receive\": 9
}
}
]
}
}",
"filterType": "any",
"filterStatus": "any",
"topN": "10"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
harInput: '{\n "log": {\n "version": "1.2",\n "entries": [\n {\n "time": 220,\n "request": {\n "method": "GET",\n "url": "https://example.com/"\n },\n "response": {\n "status": 200,\n "content": {\n "size": 1256,\n "mimeType": "text/html"\n },\n "bodySize": 1256,\n "headersSize": 180\n },\n "timings": {\n "blocked": 5,\n "dns": 12,\n "connect": 30,\n "ssl": 18,\n "send": 1,\n "wait": 150,\n "receive": 22\n }\n },\n {\n "time": 95,\n "request": {\n "method": "GET",\n "url": "https://example.com/assets/app.css"\n },\n "response": {\n "status": 200,\n "content": {\n "size": 4321,\n "mimeType": "text/css"\n },\n "bodySize": 4321,\n "headersSize": 140\n },\n "timings": {\n "blocked": 1,\n "dns": 0,\n "connect": 0,\n "ssl": 0,\n "send": 0,\n "wait": 70,\n "receive": 24\n }\n },\n {\n "time": 950,\n "request": {\n "method": "GET",\n "url": "https://cdn.example.com/lib.js"\n },\n "response": {\n "status": 200,\n "content": {\n "size": 89000,\n "mimeType": "application/javascript"\n },\n "bodySize": 89000,\n "headersSize": 150\n },\n "timings": {\n "blocked": 2,\n "dns": 18,\n "connect": 25,\n "ssl": 20,\n "send": 0,\n "wait": 860,\n "receive": 25\n }\n },\n {\n "time": 320,\n "request": {\n "method": "POST",\n "url": "https://api.example.com/v1/orders"\n },\n "response": {\n "status": 201,\n "content": {\n "size": 142,\n "mimeType": "application/json"\n },\n "bodySize": 142,\n "headersSize": 130\n },\n "timings": {\n "blocked": 1,\n "dns": 8,\n "connect": 22,\n "ssl": 18,\n "send": 1,\n "wait": 240,\n "receive": 30\n }\n },\n {\n "time": 80,\n "request": {\n "method": "GET",\n "url": "https://api.example.com/v1/missing"\n },\n "response": {\n "status": 404,\n "content": {\n "size": 35,\n "mimeType": "application/json"\n },\n "bodySize": 35,\n "headersSize": 110\n },\n "timings": {\n "blocked": 1,\n "dns": 0,\n "connect": 0,\n "ssl": 0,\n "send": 0,\n "wait": 70,\n "receive": 9\n }\n }\n ]\n }\n}',
filterType: 'any',
filterStatus: 'any',
topN: '10'
})
};
fetch('https://api.iotools.cloud/v1/tool/har-file-performance-analyzer', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.iotools.cloud/v1/tool/har-file-performance-analyzer",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'harInput' => '{
"log": {
"version": "1.2",
"entries": [
{
"time": 220,
"request": {
"method": "GET",
"url": "https://example.com/"
},
"response": {
"status": 200,
"content": {
"size": 1256,
"mimeType": "text/html"
},
"bodySize": 1256,
"headersSize": 180
},
"timings": {
"blocked": 5,
"dns": 12,
"connect": 30,
"ssl": 18,
"send": 1,
"wait": 150,
"receive": 22
}
},
{
"time": 95,
"request": {
"method": "GET",
"url": "https://example.com/assets/app.css"
},
"response": {
"status": 200,
"content": {
"size": 4321,
"mimeType": "text/css"
},
"bodySize": 4321,
"headersSize": 140
},
"timings": {
"blocked": 1,
"dns": 0,
"connect": 0,
"ssl": 0,
"send": 0,
"wait": 70,
"receive": 24
}
},
{
"time": 950,
"request": {
"method": "GET",
"url": "https://cdn.example.com/lib.js"
},
"response": {
"status": 200,
"content": {
"size": 89000,
"mimeType": "application/javascript"
},
"bodySize": 89000,
"headersSize": 150
},
"timings": {
"blocked": 2,
"dns": 18,
"connect": 25,
"ssl": 20,
"send": 0,
"wait": 860,
"receive": 25
}
},
{
"time": 320,
"request": {
"method": "POST",
"url": "https://api.example.com/v1/orders"
},
"response": {
"status": 201,
"content": {
"size": 142,
"mimeType": "application/json"
},
"bodySize": 142,
"headersSize": 130
},
"timings": {
"blocked": 1,
"dns": 8,
"connect": 22,
"ssl": 18,
"send": 1,
"wait": 240,
"receive": 30
}
},
{
"time": 80,
"request": {
"method": "GET",
"url": "https://api.example.com/v1/missing"
},
"response": {
"status": 404,
"content": {
"size": 35,
"mimeType": "application/json"
},
"bodySize": 35,
"headersSize": 110
},
"timings": {
"blocked": 1,
"dns": 0,
"connect": 0,
"ssl": 0,
"send": 0,
"wait": 70,
"receive": 9
}
}
]
}
}',
'filterType' => 'any',
'filterStatus' => 'any',
'topN' => '10'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.iotools.cloud/v1/tool/har-file-performance-analyzer"
payload := strings.NewReader("{\n \"harInput\": \"{\\n \\\"log\\\": {\\n \\\"version\\\": \\\"1.2\\\",\\n \\\"entries\\\": [\\n {\\n \\\"time\\\": 220,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"GET\\\",\\n \\\"url\\\": \\\"https://example.com/\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 200,\\n \\\"content\\\": {\\n \\\"size\\\": 1256,\\n \\\"mimeType\\\": \\\"text/html\\\"\\n },\\n \\\"bodySize\\\": 1256,\\n \\\"headersSize\\\": 180\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 5,\\n \\\"dns\\\": 12,\\n \\\"connect\\\": 30,\\n \\\"ssl\\\": 18,\\n \\\"send\\\": 1,\\n \\\"wait\\\": 150,\\n \\\"receive\\\": 22\\n }\\n },\\n {\\n \\\"time\\\": 95,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"GET\\\",\\n \\\"url\\\": \\\"https://example.com/assets/app.css\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 200,\\n \\\"content\\\": {\\n \\\"size\\\": 4321,\\n \\\"mimeType\\\": \\\"text/css\\\"\\n },\\n \\\"bodySize\\\": 4321,\\n \\\"headersSize\\\": 140\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 1,\\n \\\"dns\\\": 0,\\n \\\"connect\\\": 0,\\n \\\"ssl\\\": 0,\\n \\\"send\\\": 0,\\n \\\"wait\\\": 70,\\n \\\"receive\\\": 24\\n }\\n },\\n {\\n \\\"time\\\": 950,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"GET\\\",\\n \\\"url\\\": \\\"https://cdn.example.com/lib.js\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 200,\\n \\\"content\\\": {\\n \\\"size\\\": 89000,\\n \\\"mimeType\\\": \\\"application/javascript\\\"\\n },\\n \\\"bodySize\\\": 89000,\\n \\\"headersSize\\\": 150\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 2,\\n \\\"dns\\\": 18,\\n \\\"connect\\\": 25,\\n \\\"ssl\\\": 20,\\n \\\"send\\\": 0,\\n \\\"wait\\\": 860,\\n \\\"receive\\\": 25\\n }\\n },\\n {\\n \\\"time\\\": 320,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"POST\\\",\\n \\\"url\\\": \\\"https://api.example.com/v1/orders\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 201,\\n \\\"content\\\": {\\n \\\"size\\\": 142,\\n \\\"mimeType\\\": \\\"application/json\\\"\\n },\\n \\\"bodySize\\\": 142,\\n \\\"headersSize\\\": 130\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 1,\\n \\\"dns\\\": 8,\\n \\\"connect\\\": 22,\\n \\\"ssl\\\": 18,\\n \\\"send\\\": 1,\\n \\\"wait\\\": 240,\\n \\\"receive\\\": 30\\n }\\n },\\n {\\n \\\"time\\\": 80,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"GET\\\",\\n \\\"url\\\": \\\"https://api.example.com/v1/missing\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 404,\\n \\\"content\\\": {\\n \\\"size\\\": 35,\\n \\\"mimeType\\\": \\\"application/json\\\"\\n },\\n \\\"bodySize\\\": 35,\\n \\\"headersSize\\\": 110\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 1,\\n \\\"dns\\\": 0,\\n \\\"connect\\\": 0,\\n \\\"ssl\\\": 0,\\n \\\"send\\\": 0,\\n \\\"wait\\\": 70,\\n \\\"receive\\\": 9\\n }\\n }\\n ]\\n }\\n}\",\n \"filterType\": \"any\",\n \"filterStatus\": \"any\",\n \"topN\": \"10\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.iotools.cloud/v1/tool/har-file-performance-analyzer")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"harInput\": \"{\\n \\\"log\\\": {\\n \\\"version\\\": \\\"1.2\\\",\\n \\\"entries\\\": [\\n {\\n \\\"time\\\": 220,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"GET\\\",\\n \\\"url\\\": \\\"https://example.com/\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 200,\\n \\\"content\\\": {\\n \\\"size\\\": 1256,\\n \\\"mimeType\\\": \\\"text/html\\\"\\n },\\n \\\"bodySize\\\": 1256,\\n \\\"headersSize\\\": 180\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 5,\\n \\\"dns\\\": 12,\\n \\\"connect\\\": 30,\\n \\\"ssl\\\": 18,\\n \\\"send\\\": 1,\\n \\\"wait\\\": 150,\\n \\\"receive\\\": 22\\n }\\n },\\n {\\n \\\"time\\\": 95,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"GET\\\",\\n \\\"url\\\": \\\"https://example.com/assets/app.css\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 200,\\n \\\"content\\\": {\\n \\\"size\\\": 4321,\\n \\\"mimeType\\\": \\\"text/css\\\"\\n },\\n \\\"bodySize\\\": 4321,\\n \\\"headersSize\\\": 140\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 1,\\n \\\"dns\\\": 0,\\n \\\"connect\\\": 0,\\n \\\"ssl\\\": 0,\\n \\\"send\\\": 0,\\n \\\"wait\\\": 70,\\n \\\"receive\\\": 24\\n }\\n },\\n {\\n \\\"time\\\": 950,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"GET\\\",\\n \\\"url\\\": \\\"https://cdn.example.com/lib.js\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 200,\\n \\\"content\\\": {\\n \\\"size\\\": 89000,\\n \\\"mimeType\\\": \\\"application/javascript\\\"\\n },\\n \\\"bodySize\\\": 89000,\\n \\\"headersSize\\\": 150\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 2,\\n \\\"dns\\\": 18,\\n \\\"connect\\\": 25,\\n \\\"ssl\\\": 20,\\n \\\"send\\\": 0,\\n \\\"wait\\\": 860,\\n \\\"receive\\\": 25\\n }\\n },\\n {\\n \\\"time\\\": 320,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"POST\\\",\\n \\\"url\\\": \\\"https://api.example.com/v1/orders\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 201,\\n \\\"content\\\": {\\n \\\"size\\\": 142,\\n \\\"mimeType\\\": \\\"application/json\\\"\\n },\\n \\\"bodySize\\\": 142,\\n \\\"headersSize\\\": 130\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 1,\\n \\\"dns\\\": 8,\\n \\\"connect\\\": 22,\\n \\\"ssl\\\": 18,\\n \\\"send\\\": 1,\\n \\\"wait\\\": 240,\\n \\\"receive\\\": 30\\n }\\n },\\n {\\n \\\"time\\\": 80,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"GET\\\",\\n \\\"url\\\": \\\"https://api.example.com/v1/missing\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 404,\\n \\\"content\\\": {\\n \\\"size\\\": 35,\\n \\\"mimeType\\\": \\\"application/json\\\"\\n },\\n \\\"bodySize\\\": 35,\\n \\\"headersSize\\\": 110\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 1,\\n \\\"dns\\\": 0,\\n \\\"connect\\\": 0,\\n \\\"ssl\\\": 0,\\n \\\"send\\\": 0,\\n \\\"wait\\\": 70,\\n \\\"receive\\\": 9\\n }\\n }\\n ]\\n }\\n}\",\n \"filterType\": \"any\",\n \"filterStatus\": \"any\",\n \"topN\": \"10\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.iotools.cloud/v1/tool/har-file-performance-analyzer")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"harInput\": \"{\\n \\\"log\\\": {\\n \\\"version\\\": \\\"1.2\\\",\\n \\\"entries\\\": [\\n {\\n \\\"time\\\": 220,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"GET\\\",\\n \\\"url\\\": \\\"https://example.com/\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 200,\\n \\\"content\\\": {\\n \\\"size\\\": 1256,\\n \\\"mimeType\\\": \\\"text/html\\\"\\n },\\n \\\"bodySize\\\": 1256,\\n \\\"headersSize\\\": 180\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 5,\\n \\\"dns\\\": 12,\\n \\\"connect\\\": 30,\\n \\\"ssl\\\": 18,\\n \\\"send\\\": 1,\\n \\\"wait\\\": 150,\\n \\\"receive\\\": 22\\n }\\n },\\n {\\n \\\"time\\\": 95,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"GET\\\",\\n \\\"url\\\": \\\"https://example.com/assets/app.css\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 200,\\n \\\"content\\\": {\\n \\\"size\\\": 4321,\\n \\\"mimeType\\\": \\\"text/css\\\"\\n },\\n \\\"bodySize\\\": 4321,\\n \\\"headersSize\\\": 140\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 1,\\n \\\"dns\\\": 0,\\n \\\"connect\\\": 0,\\n \\\"ssl\\\": 0,\\n \\\"send\\\": 0,\\n \\\"wait\\\": 70,\\n \\\"receive\\\": 24\\n }\\n },\\n {\\n \\\"time\\\": 950,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"GET\\\",\\n \\\"url\\\": \\\"https://cdn.example.com/lib.js\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 200,\\n \\\"content\\\": {\\n \\\"size\\\": 89000,\\n \\\"mimeType\\\": \\\"application/javascript\\\"\\n },\\n \\\"bodySize\\\": 89000,\\n \\\"headersSize\\\": 150\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 2,\\n \\\"dns\\\": 18,\\n \\\"connect\\\": 25,\\n \\\"ssl\\\": 20,\\n \\\"send\\\": 0,\\n \\\"wait\\\": 860,\\n \\\"receive\\\": 25\\n }\\n },\\n {\\n \\\"time\\\": 320,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"POST\\\",\\n \\\"url\\\": \\\"https://api.example.com/v1/orders\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 201,\\n \\\"content\\\": {\\n \\\"size\\\": 142,\\n \\\"mimeType\\\": \\\"application/json\\\"\\n },\\n \\\"bodySize\\\": 142,\\n \\\"headersSize\\\": 130\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 1,\\n \\\"dns\\\": 8,\\n \\\"connect\\\": 22,\\n \\\"ssl\\\": 18,\\n \\\"send\\\": 1,\\n \\\"wait\\\": 240,\\n \\\"receive\\\": 30\\n }\\n },\\n {\\n \\\"time\\\": 80,\\n \\\"request\\\": {\\n \\\"method\\\": \\\"GET\\\",\\n \\\"url\\\": \\\"https://api.example.com/v1/missing\\\"\\n },\\n \\\"response\\\": {\\n \\\"status\\\": 404,\\n \\\"content\\\": {\\n \\\"size\\\": 35,\\n \\\"mimeType\\\": \\\"application/json\\\"\\n },\\n \\\"bodySize\\\": 35,\\n \\\"headersSize\\\": 110\\n },\\n \\\"timings\\\": {\\n \\\"blocked\\\": 1,\\n \\\"dns\\\": 0,\\n \\\"connect\\\": 0,\\n \\\"ssl\\\": 0,\\n \\\"send\\\": 0,\\n \\\"wait\\\": 70,\\n \\\"receive\\\": 9\\n }\\n }\\n ]\\n }\\n}\",\n \"filterType\": \"any\",\n \"filterStatus\": \"any\",\n \"topN\": \"10\"\n}"
response = http.request(request)
puts response.read_body{
"tool": "har-file-performance-analyzer",
"tool_version": "1.0.1",
"outputs": {
"summary": [
{
"metric": "Total Requests",
"value": "5"
},
{
"metric": "Transfer Size",
"value": "93.23 KB"
},
{
"metric": "Content Size",
"value": "92.53 KB"
},
{
"metric": "Average Time",
"value": "333 ms"
},
{
"metric": "Median Time",
"value": "220 ms"
},
{
"metric": "P90 Time",
"value": "698 ms"
},
{
"metric": "Average TTFB",
"value": "278 ms"
},
{
"metric": "OK / Redirect / Error",
"value": "4 / 0 / 1"
},
{
"metric": "Unique Domains",
"value": "3"
}
],
"byType": [
{
"type": "script",
"requests": "1",
"transfer": "87.06 KB"
},
{
"type": "stylesheet",
"requests": "1",
"transfer": "4.36 KB"
},
{
"type": "document",
"requests": "1",
"transfer": "1.40 KB"
},
{
"type": "xhr",
"requests": "2",
"transfer": "417 B"
}
],
"byDomain": [
{
"domain": "example.com",
"requests": "2",
"transfer": "5.76 KB",
"slowest-request": "220 ms"
},
{
"domain": "api.example.com",
"requests": "2",
"transfer": "417 B",
"slowest-request": "320 ms"
},
{
"domain": "cdn.example.com",
"requests": "1",
"transfer": "87.06 KB",
"slowest-request": "950 ms"
}
],
"slowest": [
{
"url": "https://cdn.example.com/lib.js",
"time": "950 ms",
"status": "200"
},
{
"url": "https://api.example.com/v1/orders",
"time": "320 ms",
"status": "201"
},
{
"url": "https://example.com/",
"time": "220 ms",
"status": "200"
},
{
"url": "https://example.com/assets/app.css",
"time": "95 ms",
"status": "200"
},
{
"url": "https://api.example.com/v1/missing",
"time": "80 ms",
"status": "404"
}
],
"largest": [
{
"url": "https://cdn.example.com/lib.js",
"transfer-size": "87.06 KB",
"status": "200"
},
{
"url": "https://example.com/assets/app.css",
"transfer-size": "4.36 KB",
"status": "200"
},
{
"url": "https://example.com/",
"transfer-size": "1.40 KB",
"status": "200"
},
{
"url": "https://api.example.com/v1/orders",
"transfer-size": "272 B",
"status": "201"
},
{
"url": "https://api.example.com/v1/missing",
"transfer-size": "145 B",
"status": "404"
}
]
},
"credits_used": 3,
"credits_remaining": null
}{
"type": "https://iotools.cloud/docs/errors/validation_error",
"title": "Invalid request",
"status": 400,
"code": "validation_error",
"detail": "One or more inputs are invalid — see `fields`.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11",
"fields": {
"inputString": "Required"
}
}{
"type": "https://iotools.cloud/docs/errors/invalid_api_key",
"title": "Invalid API key",
"status": 401,
"code": "invalid_api_key",
"detail": "Provide 'Authorization: Bearer <key>'.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11"
}{
"type": "https://iotools.cloud/docs/errors/insufficient_credits",
"title": "Insufficient credits",
"status": 402,
"code": "insufficient_credits",
"detail": "This call costs 1 credit and 0 remain in this month's allowance.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11",
"credits_used": 0,
"credits_remaining": 0
}{
"type": "https://iotools.cloud/docs/errors/tool_not_allowed",
"title": "Tool not available over the API",
"status": 403,
"code": "tool_not_allowed",
"detail": "\"Background Remover\" is available on iotools.cloud but has no API endpoint.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11"
}{
"type": "https://iotools.cloud/docs/errors/tool_not_found",
"title": "Tool not found",
"status": 404,
"code": "tool_not_found",
"detail": "No tool with that slug. See GET /v1/tools/list.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11"
}{
"type": "https://iotools.cloud/docs/errors/payload_too_large",
"title": "Payload too large",
"status": 413,
"code": "payload_too_large",
"detail": "Request body exceeds this tool's size limit.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11"
}{
"type": "https://iotools.cloud/docs/errors/rate_limited",
"title": "Rate limit exceeded",
"status": 429,
"code": "rate_limited",
"detail": "Too many requests. Retry in 30s.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11",
"retry_after": 30
}{
"type": "https://iotools.cloud/docs/errors/processing_error",
"title": "Tool failed to run",
"status": 500,
"code": "processing_error",
"detail": "The tool failed to run. Please try again.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11",
"credits_used": 0
}{
"type": "https://iotools.cloud/docs/errors/tool_disabled",
"title": "Tool temporarily disabled",
"status": 503,
"code": "tool_disabled",
"detail": "This tool is temporarily unavailable. Try again shortly.",
"request_id": "e4042b29-8f1e-4c7a-9b52-6f0d1a3c7e11"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
Tool output
Show child attributes
Show child attributes
The tool's slug, echoing the {slug} in the request path.
Output-contract version for this tool.
Credits this call consumed, after any settlement refund. 0 when metering is disabled.
Credits left in the current monthly allowance, or null when metering is disabled.
Correlation id, also sent as x-request-id.
Was this page helpful?
⌘I