Skip to main content
GET
/
openapi
/
v1
/
etf
/
compare
/
fund-composition
Compare fund composition
curl --request GET \
  --url https://api.hayinsights.com/openapi/v1/etf/compare/fund-composition \
  --header 'X-API-Key: <api-key>'
{
  "success": true,
  "statusCode": 200,
  "data": [
    {
      "fundCode": "VESAF",
      "assetAllocation": {
        "bond": 0,
        "stock": 2154943464100,
        "others": 318018107481,
        "total": 2472961571581,
        "bondPercent": 0,
        "stockPercent": 87.14,
        "othersPercent": 12.86,
        "currency": "VND",
        "month": "2026-05"
      },
      "portfolio": [
        {
          "symbol": "MBB",
          "price": 25000,
          "volume": 7706790,
          "weightPercent": 7.79,
          "currency": "VND",
          "month": "2026-05"
        },
        {
          "symbol": "BVH",
          "price": 67700,
          "volume": 2801910,
          "weightPercent": 7.67,
          "currency": "VND",
          "month": "2026-05"
        }
      ],
      "sectorAllocation": [
        {
          "sectorName": "Ngân hàng",
          "value": 550441424500,
          "percent": 24.39,
          "currency": "VND",
          "month": "2026-04"
        }
      ]
    }
  ],
  "meta": {
    "timestamp": "2026-06-19T08:50:39.000Z"
  }
}

Authorizations

X-API-Key
string
header
required

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

codes
string
required

Comma-separated list of 2 to 5 Vietnamese fund codes to compare.

Example:

"VESAF,VEOF"

Response

Composition for each requested fund.

Standard success envelope shared by every endpoint. Each operation's response wrapper extends this (via allOf) and adds a typed data property.

success
boolean
required

Always true for a successful response.

Example:

true

statusCode
integer
required

Mirrors the HTTP status code.

Example:

200

data
object[]
required
meta
object

Response metadata. Always present; timestamp is the server time the response was generated.