curl --request GET \
--url https://api-v2.hayinsights.com/openapi/v1/macro/indicators/fdi \
--header 'X-API-Key: <api-key>'import requests
url = "https://api-v2.hayinsights.com/openapi/v1/macro/indicators/fdi"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api-v2.hayinsights.com/openapi/v1/macro/indicators/fdi', 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-v2.hayinsights.com/openapi/v1/macro/indicators/fdi",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-v2.hayinsights.com/openapi/v1/macro/indicators/fdi"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-v2.hayinsights.com/openapi/v1/macro/indicators/fdi")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.hayinsights.com/openapi/v1/macro/indicators/fdi")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 200,
"data": {
"indicator": "fdi",
"metrics": [
{
"key": "outward",
"label": "Outward",
"unit": ""
},
{
"key": "inward",
"label": "Inward",
"unit": ""
}
],
"columns": [
{
"period": "Q2 2026",
"date": "2026-06-30"
},
{
"period": "Q3 2026",
"date": "2026-09-30"
}
],
"rows": [
{
"country": "US",
"countryName": "United States",
"available": false,
"unit": null,
"values": [
null,
null
],
"display": [
{
"outward": "—",
"inward": "—"
},
{
"outward": "—",
"inward": "—"
}
],
"markers": [
{},
{}
]
},
{
"country": "JP",
"countryName": "Japan",
"available": true,
"unit": "Million USD",
"values": [
{
"outward": 53261.8,
"inward": 5729.2
},
null
],
"display": [
{
"outward": "53,261.8",
"inward": "5,729.2"
},
{
"outward": "—",
"inward": "—"
}
],
"markers": [
{},
{}
]
},
{
"country": "VN",
"countryName": "Vietnam",
"available": true,
"unit": "Million USD",
"values": [
{
"outward": null,
"inward": 19451.5
},
{
"outward": null,
"inward": 15707
}
],
"display": [
{
"outward": "—",
"inward": "19,451.5"
},
{
"outward": "—",
"inward": "15,707.0"
}
],
"markers": [
{},
{}
]
}
],
"latestPeriod": "2026-Q3",
"source": "JETRO",
"knowledgeAt": "2026-09-10T00:00:00.000Z",
"wasRestated": false
},
"meta": {
"timestamp": "2026-10-16T04:00:00.000Z"
}
}{
"success": false,
"statusCode": 400,
"error": {
"code": "INTERNAL_ERROR",
"message": [
"Invalid type parameter. Must be \"gdp\", \"cpi\", \"pce\", or \"import-export\"",
"Type parameter is required"
]
},
"meta": {
"error": "Bad Request",
"statusCode": 400,
"timestamp": "2026-06-19T08:34:08.081Z"
}
}{
"success": false,
"statusCode": 401,
"error": {
"code": "API_KEY_INVALID",
"message": "Invalid API key"
},
"meta": {
"timestamp": "2026-06-19T08:34:08.023Z"
}
}{
"success": false,
"statusCode": 403,
"error": {
"code": "FEATURE_NOT_IN_PLAN",
"message": "Your plan does not include this feature"
},
"meta": {
"timestamp": "2026-06-19T08:34:08.100Z"
}
}{
"success": false,
"statusCode": 404,
"error": {
"code": "INTERNAL_ERROR",
"message": "Commodity 'zzz-nope' not found"
},
"meta": {
"error": "Not Found",
"statusCode": 404,
"timestamp": "2026-06-19T08:34:08.205Z"
}
}{
"success": false,
"statusCode": 429,
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded"
},
"meta": {
"timestamp": "2026-06-19T08:34:09.000Z"
}
}{
"success": false,
"statusCode": 500,
"error": {
"code": "INTERNAL_ERROR",
"message": "Internal server error"
},
"meta": {
"timestamp": "2026-06-19T08:34:10.000Z"
}
}Indicator — FDI table (US/JP/VN)
Foreign direct investment for the United States, Japan and Vietnam over the two most recent quarters,
oldest to newest. The columns are the two latest quarters with data in either Japan or Vietnam — not
anchored to today, because JETRO publishes about two months after the quarter ends. Each cell holds
two metrics, outward and inward, in million USD (the unit is on rows[].unit).
JP(JETRO): outward and inward FDI for the quarter. A negative value is a net withdrawal.VN(Foreign Investment Agency, Ministry of Finance):inwardonly — registered capital within the quarter (the three months of that quarter, not year to date). Only complete quarters appear;outwardis always null.US: no source yet —available: false, every cell—.
A country without a figure for a quarter returns a null cell (display shows —), never 0. values
holds the raw numbers and display the formatted strings. source names JETRO, the Japanese source.
For longer series use /macro/fdi/flows (Japan) or /macro/fdi/vn/flows (Vietnam).
curl --request GET \
--url https://api-v2.hayinsights.com/openapi/v1/macro/indicators/fdi \
--header 'X-API-Key: <api-key>'import requests
url = "https://api-v2.hayinsights.com/openapi/v1/macro/indicators/fdi"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api-v2.hayinsights.com/openapi/v1/macro/indicators/fdi', 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-v2.hayinsights.com/openapi/v1/macro/indicators/fdi",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-v2.hayinsights.com/openapi/v1/macro/indicators/fdi"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api-v2.hayinsights.com/openapi/v1/macro/indicators/fdi")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.hayinsights.com/openapi/v1/macro/indicators/fdi")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"statusCode": 200,
"data": {
"indicator": "fdi",
"metrics": [
{
"key": "outward",
"label": "Outward",
"unit": ""
},
{
"key": "inward",
"label": "Inward",
"unit": ""
}
],
"columns": [
{
"period": "Q2 2026",
"date": "2026-06-30"
},
{
"period": "Q3 2026",
"date": "2026-09-30"
}
],
"rows": [
{
"country": "US",
"countryName": "United States",
"available": false,
"unit": null,
"values": [
null,
null
],
"display": [
{
"outward": "—",
"inward": "—"
},
{
"outward": "—",
"inward": "—"
}
],
"markers": [
{},
{}
]
},
{
"country": "JP",
"countryName": "Japan",
"available": true,
"unit": "Million USD",
"values": [
{
"outward": 53261.8,
"inward": 5729.2
},
null
],
"display": [
{
"outward": "53,261.8",
"inward": "5,729.2"
},
{
"outward": "—",
"inward": "—"
}
],
"markers": [
{},
{}
]
},
{
"country": "VN",
"countryName": "Vietnam",
"available": true,
"unit": "Million USD",
"values": [
{
"outward": null,
"inward": 19451.5
},
{
"outward": null,
"inward": 15707
}
],
"display": [
{
"outward": "—",
"inward": "19,451.5"
},
{
"outward": "—",
"inward": "15,707.0"
}
],
"markers": [
{},
{}
]
}
],
"latestPeriod": "2026-Q3",
"source": "JETRO",
"knowledgeAt": "2026-09-10T00:00:00.000Z",
"wasRestated": false
},
"meta": {
"timestamp": "2026-10-16T04:00:00.000Z"
}
}{
"success": false,
"statusCode": 400,
"error": {
"code": "INTERNAL_ERROR",
"message": [
"Invalid type parameter. Must be \"gdp\", \"cpi\", \"pce\", or \"import-export\"",
"Type parameter is required"
]
},
"meta": {
"error": "Bad Request",
"statusCode": 400,
"timestamp": "2026-06-19T08:34:08.081Z"
}
}{
"success": false,
"statusCode": 401,
"error": {
"code": "API_KEY_INVALID",
"message": "Invalid API key"
},
"meta": {
"timestamp": "2026-06-19T08:34:08.023Z"
}
}{
"success": false,
"statusCode": 403,
"error": {
"code": "FEATURE_NOT_IN_PLAN",
"message": "Your plan does not include this feature"
},
"meta": {
"timestamp": "2026-06-19T08:34:08.100Z"
}
}{
"success": false,
"statusCode": 404,
"error": {
"code": "INTERNAL_ERROR",
"message": "Commodity 'zzz-nope' not found"
},
"meta": {
"error": "Not Found",
"statusCode": 404,
"timestamp": "2026-06-19T08:34:08.205Z"
}
}{
"success": false,
"statusCode": 429,
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Rate limit exceeded"
},
"meta": {
"timestamp": "2026-06-19T08:34:09.000Z"
}
}{
"success": false,
"statusCode": 500,
"error": {
"code": "INTERNAL_ERROR",
"message": "Internal server error"
},
"meta": {
"timestamp": "2026-06-19T08:34:10.000Z"
}
}Authorizations
Your HayInsights API key (prefixed apk_). Create and manage keys in the
HayInsights dashboard (Account → API keys).
Send it in the X-API-Key header on every request to /openapi/v1/*.
Which data domains you may access and your request quota are both governed by
the subscription plan attached to the key — see the Plans & features and
Rate limits guides.
Query Parameters
Source country of the JETRO series. Only jp is accepted; the response always holds the US, JP and VN rows.
jp Backtest: return exactly what the system knew at the end of that day (UTC), not later revisions by the source. Omit for the latest data.
"2026-09-01"
Response
FDI indicator table.
Standard success envelope shared by every endpoint. Each operation's response
wrapper extends this (via allOf) and adds a typed data property.
Always true for a successful response.
true
Mirrors the HTTP status code.
200
Show child attributes
Show child attributes
Response metadata. Always present; timestamp is the server time the response was generated.
Show child attributes
Show child attributes