Handoff

360 export and files

Extend a polar, then write AeroDyn, QBlade, XFOIL, or a Selig file.

Two calls finish a handoff. Extrapolate extends a solved polar toward 360 degrees. Export writes the file. Extended points stay marked. They are a model past the solved range, not a measurement. XFOIL and AVL files keep the solved range even if you pass an extended polar.

Work this page from top to bottom. Read Before you call this API, then Request syntax, then the full Step by step walkthrough and the Quick checklist. Fill each payload field from the parameters table, send one of the language samples, and match the HTTP status to the accepted body or to a rejected body. Sample numbers show field names only — they are not measured aerodynamic results. If a field or status is unclear, use the contact links at the end and include the status and the error text.

How to use this documentation page

  1. Skim the intro so you know what meter this analysis spends and what geometry it needs.
  2. Complete the step-by-step walkthrough once with the dummy shapes, then again with your live key and real inputs.
  3. Copy a language sample, change only the values you must change, and keep JSON key names identical.
  4. On every response, read status first. Only then parse coefficients, gates, or file content.
  5. When automation returns 202, open Jobs and usage and poll until the job finishes.

Extend a solved polar

POST https://henfoil.hendoi.com/api/v1/polars/extrapolate

Before you call this API

  • You have an active HENDOI account and a live HENFOIL API key (hfk_…).
  • You know which plan meters this call spends (automation apiRequests, and often polars, optimize, or compute credits).
  • You have either a stored airfoilId, a NACA code, or coordinate / .dat text ready when the endpoint needs geometry.
  • You will treat every numeric sample on this page as a shape guide, not as measured flight data.

Request syntax

Every call has the same four parts. Fill them in this order.

  1. Method. POST.
  2. URL. https://henfoil.hendoi.com/api/v1/polars/extrapolate. The host is the production API. Do not change it.
  3. Header. Authorization: Bearer hfk_demo_4c91e2ab8d07. Replace the dummy key with the key from Settings, then API, then Generate now. You can send the raw key in X-Henfoil-Key instead, with no Bearer prefix.
  4. Body. One JSON object, with header Content-Type: application/json.

Step by step

Follow this guide in order. Each step says what to type, where it goes, and what to check next. After the last step, compare your HTTP status with the accepted body and the rejected bodies further down.

  1. Before you start. Sign in at https://hendoi.com/login, open HENFOIL, then Settings → API → Generate now. Copy the full hfk_… key once. Confirm your plan still has usage remaining for automation calls.
  2. Confirm the endpoint. You will send POST to https://henfoil.hendoi.com/api/v1/polars/extrapolate. Keep the production host. Do not point samples at localhost in a shipped integration.
  3. Attach the key. Prefer Authorization: Bearer hfk_…. Or send the raw key in X-Henfoil-Key with no Bearer prefix. Never put the key in the JSON body or in a query string.
  4. Build one JSON object. Add header Content-Type: application/json. Numbers stay numbers (no quotes). Strings stay quoted. Omit optional keys when you want the server default.
  5. Optionally set polar. Example: object. The polar object from POST /api/v1/polars. Omit the key to keep the server default.
  6. Optionally set aspectRatio. Example: 8. Written onto the polar before the extension. Omit the key to keep the server default.
  7. Take polar from the Polars response, including points.
  8. Send that object as polar.
  9. If you omit polar, send geometry instead. The server sweeps a polar first and spends one polar.
  10. Read the extended points. Added points are marked.
  11. Send the request. Use any of the six language samples below. Expect HTTP 200 when the call matches this page's accepted example (or HTTP 202 with jobId when a long solve is queued).
  12. Read the JSON by name. On success, start with points. Ignore sample coefficient magnitudes — they are placeholders for field names only.
  13. Handle failure before success fields. If status is 400, 401, or 403, read error (and meter on 403). Do not parse lift or drag from an error body.
  14. Verify before the next call. Confirm status, remaining automation budget (X-Henfoil-Api-Remaining or GET /api/v1/usage), and that honesty / gate fields (when present) match what you expect for a screening result — not a certification claim.
  15. If you are stuck. Copy the HTTP status and the full error string, then use the contact block at the bottom of this page (WhatsApp or support@hendoi.com).

Quick checklist

  • □ Method is POST and URL path is exact.
  • □ Live API key is in the Authorization (or X-Henfoil-Key) header.
  • □ JSON body uses the field names in the parameters table; types match (number vs string).
  • □ Client branches on HTTP status before reading aerodynamic fields.
  • □ Error path logs error / meter for support.

Parameters

Required means the server needs that field. Optional means a default is already in place. One of these means you send exactly one of the listed geometry fields.

FieldRequiredExampleMeaning
polarYes, or geometryobjectThe polar object from POST /api/v1/polars.
aspectRatioNo8Written onto the polar before the extension.

How to fill the payload

Treat the payload as a form. Each name is a JSON key. Send numbers as numbers, without quotes. Send text in quotes. Omit an optional key when you want the server default. Send exactly one geometry source when the table says the field is one of a set.

  • polar — Yes, or geometry. Example: object. The polar object from POST /api/v1/polars.
  • aspectRatio — Optional. Example: 8. Written onto the polar before the extension.

The example object below is the body to send. It uses polar. Copy it, replace the dummy values with yours, and send it with Content-Type: application/json.

Example request

The key hfk_demo_4c91e2ab8d07 is a dummy. It is not a live key, and the server rejects it. Replace it before you send the call. The other values are dummy parameters in the same shape the server reads, so you can see where each number goes.

{
  "polar": {
    "re": 500000,
    "points": [
      {
        "aoaDeg": -4,
        "cl": 0.1,
        "cd": 0.01,
        "converged": true
      },
      {
        "aoaDeg": 12,
        "cl": 1.1,
        "cd": 0.02,
        "converged": true
      }
    ]
  }
}

If the request is accepted

HTTP 200 means the key was accepted and this call finished. Read the status in your client first, then parse the JSON. The numbers below are placeholders so you can see the field names. A live response replaces them. Do not treat this sample as a measured result.

{
  "points": [
    {
      "aoaDeg": -4,
      "cl": 0.1,
      "extended": false
    },
    {
      "aoaDeg": 180,
      "cl": 0.0,
      "extended": true
    }
  ]
}

Read the body by name:

  • points — a list of objects. Each object includes aoaDeg, cl, extended.

If the request is not accepted

A rejected call is still JSON. Read the HTTP status, then the error string. Do not look for lift or drag fields in these bodies. Fix the named problem and send the same call again.

HTTP 400, missing or unusable input. The message changes with the field. The shape does not:

{
  "error": "Provide coordinates, text, or airfoilId."
}

HTTP 401, missing, unknown, or deactivated key. No automation call is spent:

{
  "error": "This API key is deactivated or was not recognized. Only an active key can call the API."
}

HTTP 403, a meter is used up. meter tells you which one. apiRequests is the automation budget. apiKeyAllocation is the calls assigned to this key:

{
  "error": "API usage limit reached.",
  "code": "QUOTA_EXCEEDED",
  "plan": "student",
  "upgradeTo": "professional",
  "pricingPath": "/pricing",
  "meter": "apiRequests",
  "used": 500,
  "limit": 500,
  "remaining": 0
}

When something goes wrong

  • HTTP 400 when polar.points is missing and geometry is also missing.
  • HTTP 401: the key is missing, unknown, or deactivated. No call is spent. Generate a new key and send that value.
  • HTTP 403 with code QUOTA_EXCEEDED: read meter. apiRequests is the automation budget. apiKeyAllocation is this key's assigned calls. The other meter names are the platform limit named in the message.
  • HTTP 400: read error. It names the missing field or the geometry problem. Fix that field and send the call again.
  • HTTP 202 with jobId: the solve is queued. Poll Jobs and usage until status is COMPLETED, COMPLETED_WITH_WARNINGS, FAILED, or CANCELLED. Then GET the job without partial=1.

How each language returns a bad response

  • cURL. The body prints first. The last line from -w is the HTTP status. 400 still prints a JSON body.
  • Node.js. fetch does not throw on 400, 401, or 403. Branch on res.status, then read data.error.
  • C#. GetAsync and PostAsync do not throw on those statuses. Read StatusCode, then the body string.
  • Python. urlopen raises urllib.error.HTTPError. The status is e.code. The JSON is e.read().decode().
  • PHP. curl_exec returns the body for a 400. The status is CURLINFO_HTTP_CODE. A 400 means the server answered.
  • Java. send returns the status and the body together. A 400 does not throw.
import json
from urllib.error import HTTPError
from urllib.request import urlopen
# req is the Request built in the Python sample below.
try:
    with urlopen(req) as res:
        print(res.status)
        print(json.load(res))
except HTTPError as e:
    print(e.code)
    print(json.loads(e.read().decode()))

Useful tips

  • Replace the dummy key before the first real call. A 401 on the sample key is expected.
  • Check the HTTP status before you read any coefficient. An error body has error, not a polar.
  • Read X-Henfoil-Api-Remaining before a loop. X-Henfoil-Api-Warning appears when fewer than one fifth of the calls remain.
  • Copy a sample with the Copy button, then change only the values you intend to change. Leave the key names as written.
  • If the error text does not match the body you sent, contact us with the status code and that text. The link is at the bottom of this page.

Samples

The six programs below send the same method, URL, header, and payload. The paragraph above each program says which line is the payload and which line is the response.

Send it in cURL

The payload is the JSON in single quotes after -d. Edit the values there. Keep Content-Type: application/json. Replace the dummy key. -w prints the HTTP status after the body.

curl -s -X POST \
  "https://henfoil.hendoi.com/api/v1/polars/extrapolate" \
  -H "Authorization: Bearer hfk_demo_4c91e2ab8d07" \
  -H "Content-Type: application/json" \
  -d '{"polar":{"re":500000,"points":[{"aoaDeg":-4,"cl":0.1,"cd":0.01,"converged":true},{"aoaDeg":12,"cl":1.1,"cd":0.02,"converged":true}]}}' \
  -w "\n%{http_code}\n"

Send it in Node.js

The object inside JSON.stringify is the payload. Change a property there; do not build the JSON by hand. fetch does not throw on 400 or 403. Read res.status, then data.error when the status is not 200.

const res = await fetch("https://henfoil.hendoi.com/api/v1/polars/extrapolate", {
  method: "POST",
  headers: {
    Authorization: "Bearer hfk_demo_4c91e2ab8d07",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({"polar": {"re": 500000, "points": [{"aoaDeg": -4, "cl": 0.1, "cd": 0.01, "converged": true}, {"aoaDeg": 12, "cl": 1.1, "cd": 0.02, "converged": true}]}})
});
const data = await res.json();
console.log(res.status, data);

Send it in C#

The string passed to StringContent is the JSON payload. Edit the values inside that string and keep the escaped quotes. StatusCode is the HTTP code. The following string is the raw response, success or error.

using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", "hfk_demo_4c91e2ab8d07");
var content = new StringContent(
    "{\"polar\": {\"re\": 500000, \"points\": [{\"aoaDeg\": -4, \"cl\": 0.1, \"cd\": 0.01, \"converged\": true}, {\"aoaDeg\": 12, \"cl\": 1.1, \"cd\": 0.02, \"converged\": true}]}}", Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://henfoil.hendoi.com/api/v1/polars/extrapolate", content);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());

Send it in Python

payload is the JSON text, then encoded to bytes. Edit the text inside the quotes. On 200, res.status and json.load show the accepted body. On 400, 401, or 403, urlopen raises HTTPError and the JSON is in e.read().

import json
from urllib.request import Request, urlopen
payload = "{\"polar\": {\"re\": 500000, \"points\": [{\"aoaDeg\": -4, \"cl\": 0.1, \"cd\": 0.01, \"converged\": true}, {\"aoaDeg\": 12, \"cl\": 1.1, \"cd\": 0.02, \"converged\": true}]}}".encode()
req = Request(
    "https://henfoil.hendoi.com/api/v1/polars/extrapolate",
    data=payload,
    headers={
        "Authorization": "Bearer hfk_demo_4c91e2ab8d07",
        "Content-Type": "application/json",
    },
    method="POST",
)
with urlopen(req) as res:
    print(res.status)
    print(json.load(res))

Send it in PHP

The array is the payload. json_encode turns it into JSON. Change a value in the array. CURLINFO_HTTP_CODE is the status. $body is the response text, whether the status is 200 or 400.

$payload = json_encode([
    "polar" => [
        "re" => 500000,
        "points" => [
            [
                "aoaDeg" => -4,
                "cl" => 0.1,
                "cd" => 0.01,
                "converged" => true
            ],
            [
                "aoaDeg" => 12,
                "cl" => 1.1,
                "cd" => 0.02,
                "converged" => true
            ]
        ]
    ]
]);
$ch = curl_init("https://henfoil.hendoi.com/api/v1/polars/extrapolate");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => $payload,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer hfk_demo_4c91e2ab8d07",
        "Content-Type: application/json",
    ],
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), "\n", $body;
curl_close($ch);

Send it in Java

The body string is the JSON payload. Edit the values in that string. statusCode() is the HTTP code and body() is the response text. A rejected call still returns both.

var client = java.net.http.HttpClient.newHttpClient();
var body = "{\"polar\": {\"re\": 500000, \"points\": [{\"aoaDeg\": -4, \"cl\": 0.1, \"cd\": 0.01, \"converged\": true}, {\"aoaDeg\": 12, \"cl\": 1.1, \"cd\": 0.02, \"converged\": true}]}}";
var request = java.net.http.HttpRequest.newBuilder()
    .uri(java.net.URI.create("https://henfoil.hendoi.com/api/v1/polars/extrapolate"))
    .header("Authorization", "Bearer hfk_demo_4c91e2ab8d07")
    .header("Content-Type", "application/json")
    .method("POST", java.net.http.HttpRequest.BodyPublishers.ofString(body))
    .build();
var response = client.send(request, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());

Write an AeroDyn file

POST https://henfoil.hendoi.com/api/v1/polars/export

Before you call this API

  • You have an active HENDOI account and a live HENFOIL API key (hfk_…).
  • You know which plan meters this call spends (automation apiRequests, and often polars, optimize, or compute credits).
  • You have either a stored airfoilId, a NACA code, or coordinate / .dat text ready when the endpoint needs geometry.
  • You will treat every numeric sample on this page as a shape guide, not as measured flight data.

Request syntax

Every call has the same four parts. Fill them in this order.

  1. Method. POST.
  2. URL. https://henfoil.hendoi.com/api/v1/polars/export. The host is the production API. Do not change it.
  3. Header. Authorization: Bearer hfk_demo_4c91e2ab8d07. Replace the dummy key with the key from Settings, then API, then Generate now. You can send the raw key in X-Henfoil-Key instead, with no Bearer prefix.
  4. Body. One JSON object, with header Content-Type: application/json.

Step by step

Follow this guide in order. Each step says what to type, where it goes, and what to check next. After the last step, compare your HTTP status with the accepted body and the rejected bodies further down.

  1. Before you start. Sign in at https://hendoi.com/login, open HENFOIL, then Settings → API → Generate now. Copy the full hfk_… key once. Confirm your plan still has usage remaining for automation calls.
  2. Confirm the endpoint. You will send POST to https://henfoil.hendoi.com/api/v1/polars/export. Keep the production host. Do not point samples at localhost in a shipped integration.
  3. Attach the key. Prefer Authorization: Bearer hfk_…. Or send the raw key in X-Henfoil-Key with no Bearer prefix. Never put the key in the JSON body or in a query string.
  4. Build one JSON object. Add header Content-Type: application/json. Numbers stay numbers (no quotes). Strings stay quoted. Omit optional keys when you want the server default.
  5. Optionally set format. Example: aerodyn. aerodyn, qblade, hawc2, xfoil, xflr5, avl, csv, json, tecplot. Omit the key to keep the server default.
  6. Optionally set polar. Example: object. Solved or extended polar. Omit the key to keep the server default.
  7. Optionally set name. Example: NACA 2412. Name written into the file. Omit the key to keep the server default.
  8. Optionally set re. Example: 500000. Reynolds number written into the header. Omit the key to keep the server default.
  9. Optionally set extrapolate. Example: true. Rotor formats extend when the polar is solved-range only. xfoil and avl ignore this and keep the solved range. Omit the key to keep the server default.
  10. Send format and the polar.
  11. format aerodyn is the default. Also qblade, hawc2, xfoil, xflr5, avl, csv, json.
  12. Read content or text, plus filename. Write that string to a file.
  13. Send the request. Use any of the six language samples below. Expect HTTP 200 when the call matches this page's accepted example (or HTTP 202 with jobId when a long solve is queued).
  14. Read the JSON by name. On success, start with format, filename, content. Ignore sample coefficient magnitudes — they are placeholders for field names only.
  15. Handle failure before success fields. If status is 400, 401, or 403, read error (and meter on 403). Do not parse lift or drag from an error body.
  16. Verify before the next call. Confirm status, remaining automation budget (X-Henfoil-Api-Remaining or GET /api/v1/usage), and that honesty / gate fields (when present) match what you expect for a screening result — not a certification claim.
  17. If you are stuck. Copy the HTTP status and the full error string, then use the contact block at the bottom of this page (WhatsApp or support@hendoi.com).

Quick checklist

  • □ Method is POST and URL path is exact.
  • □ Live API key is in the Authorization (or X-Henfoil-Key) header.
  • □ JSON body uses the field names in the parameters table; types match (number vs string).
  • □ Client branches on HTTP status before reading aerodynamic fields.
  • □ Error path logs error / meter for support.

Parameters

Required means the server needs that field. Optional means a default is already in place. One of these means you send exactly one of the listed geometry fields.

FieldRequiredExampleMeaning
formatNoaerodynaerodyn, qblade, hawc2, xfoil, xflr5, avl, csv, json, tecplot.
polarYes, or geometryobjectSolved or extended polar.
nameNoNACA 2412Name written into the file.
reNo500000Reynolds number written into the header.
extrapolateNotrueRotor formats extend when the polar is solved-range only. xfoil and avl ignore this and keep the solved range.

How to fill the payload

Treat the payload as a form. Each name is a JSON key. Send numbers as numbers, without quotes. Send text in quotes. Omit an optional key when you want the server default. Send exactly one geometry source when the table says the field is one of a set.

  • format — Optional. Example: aerodyn. aerodyn, qblade, hawc2, xfoil, xflr5, avl, csv, json, tecplot.
  • polar — Yes, or geometry. Example: object. Solved or extended polar.
  • name — Optional. Example: NACA 2412. Name written into the file.
  • re — Optional. Example: 500000. Reynolds number written into the header.
  • extrapolate — Optional. Example: true. Rotor formats extend when the polar is solved-range only. xfoil and avl ignore this and keep the solved range.

The example object below is the body to send. It uses format, name, re, polar. Copy it, replace the dummy values with yours, and send it with Content-Type: application/json.

Example request

The key hfk_demo_4c91e2ab8d07 is a dummy. It is not a live key, and the server rejects it. Replace it before you send the call. The other values are dummy parameters in the same shape the server reads, so you can see where each number goes.

{
  "format": "aerodyn",
  "name": "NACA 2412",
  "re": 500000,
  "polar": {
    "points": [
      {
        "aoaDeg": 0,
        "cl": 0.2,
        "cd": 0.008
      }
    ]
  }
}

If the request is accepted

HTTP 200 means the key was accepted and this call finished. Read the status in your client first, then parse the JSON. The numbers below are placeholders so you can see the field names. A live response replaces them. Do not treat this sample as a measured result.

{
  "format": "aerodyn",
  "filename": "NACA_2412.dat",
  "content": "placeholder file text"
}

Read the body by name:

  • format — text, such as an id, a name, or a message.
  • filename — text, such as an id, a name, or a message.
  • content — text, such as an id, a name, or a message.

If the request is not accepted

A rejected call is still JSON. Read the HTTP status, then the error string. Do not look for lift or drag fields in these bodies. Fix the named problem and send the same call again.

HTTP 400, missing or unusable input. The message changes with the field. The shape does not:

{
  "error": "Provide coordinates, text, or airfoilId."
}

HTTP 401, missing, unknown, or deactivated key. No automation call is spent:

{
  "error": "This API key is deactivated or was not recognized. Only an active key can call the API."
}

HTTP 403, a meter is used up. meter tells you which one. apiRequests is the automation budget. apiKeyAllocation is the calls assigned to this key:

{
  "error": "API usage limit reached.",
  "code": "QUOTA_EXCEEDED",
  "plan": "student",
  "upgradeTo": "professional",
  "pricingPath": "/pricing",
  "meter": "apiRequests",
  "used": 500,
  "limit": 500,
  "remaining": 0
}

When something goes wrong

  • An unknown format returns HTTP 400 with the formats the writer accepts.
  • HTTP 401: the key is missing, unknown, or deactivated. No call is spent. Generate a new key and send that value.
  • HTTP 403 with code QUOTA_EXCEEDED: read meter. apiRequests is the automation budget. apiKeyAllocation is this key's assigned calls. The other meter names are the platform limit named in the message.
  • HTTP 400: read error. It names the missing field or the geometry problem. Fix that field and send the call again.
  • HTTP 202 with jobId: the solve is queued. Poll Jobs and usage until status is COMPLETED, COMPLETED_WITH_WARNINGS, FAILED, or CANCELLED. Then GET the job without partial=1.

How each language returns a bad response

  • cURL. The body prints first. The last line from -w is the HTTP status. 400 still prints a JSON body.
  • Node.js. fetch does not throw on 400, 401, or 403. Branch on res.status, then read data.error.
  • C#. GetAsync and PostAsync do not throw on those statuses. Read StatusCode, then the body string.
  • Python. urlopen raises urllib.error.HTTPError. The status is e.code. The JSON is e.read().decode().
  • PHP. curl_exec returns the body for a 400. The status is CURLINFO_HTTP_CODE. A 400 means the server answered.
  • Java. send returns the status and the body together. A 400 does not throw.
import json
from urllib.error import HTTPError
from urllib.request import urlopen
# req is the Request built in the Python sample below.
try:
    with urlopen(req) as res:
        print(res.status)
        print(json.load(res))
except HTTPError as e:
    print(e.code)
    print(json.loads(e.read().decode()))

Useful tips

  • Replace the dummy key before the first real call. A 401 on the sample key is expected.
  • Check the HTTP status before you read any coefficient. An error body has error, not a polar.
  • Read X-Henfoil-Api-Remaining before a loop. X-Henfoil-Api-Warning appears when fewer than one fifth of the calls remain.
  • Copy a sample with the Copy button, then change only the values you intend to change. Leave the key names as written.
  • If the error text does not match the body you sent, contact us with the status code and that text. The link is at the bottom of this page.

Samples

The six programs below send the same method, URL, header, and payload. The paragraph above each program says which line is the payload and which line is the response.

Send it in cURL

The payload is the JSON in single quotes after -d. Edit the values there. Keep Content-Type: application/json. Replace the dummy key. -w prints the HTTP status after the body.

curl -s -X POST \
  "https://henfoil.hendoi.com/api/v1/polars/export" \
  -H "Authorization: Bearer hfk_demo_4c91e2ab8d07" \
  -H "Content-Type: application/json" \
  -d '{"format":"aerodyn","name":"NACA 2412","re":500000,"polar":{"points":[{"aoaDeg":0,"cl":0.2,"cd":0.008}]}}' \
  -w "\n%{http_code}\n"

Send it in Node.js

The object inside JSON.stringify is the payload. Change a property there; do not build the JSON by hand. fetch does not throw on 400 or 403. Read res.status, then data.error when the status is not 200.

const res = await fetch("https://henfoil.hendoi.com/api/v1/polars/export", {
  method: "POST",
  headers: {
    Authorization: "Bearer hfk_demo_4c91e2ab8d07",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({"format": "aerodyn", "name": "NACA 2412", "re": 500000, "polar": {"points": [{"aoaDeg": 0, "cl": 0.2, "cd": 0.008}]}})
});
const data = await res.json();
console.log(res.status, data);

Send it in C#

The string passed to StringContent is the JSON payload. Edit the values inside that string and keep the escaped quotes. StatusCode is the HTTP code. The following string is the raw response, success or error.

using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", "hfk_demo_4c91e2ab8d07");
var content = new StringContent(
    "{\"format\": \"aerodyn\", \"name\": \"NACA 2412\", \"re\": 500000, \"polar\": {\"points\": [{\"aoaDeg\": 0, \"cl\": 0.2, \"cd\": 0.008}]}}", Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://henfoil.hendoi.com/api/v1/polars/export", content);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());

Send it in Python

payload is the JSON text, then encoded to bytes. Edit the text inside the quotes. On 200, res.status and json.load show the accepted body. On 400, 401, or 403, urlopen raises HTTPError and the JSON is in e.read().

import json
from urllib.request import Request, urlopen
payload = "{\"format\": \"aerodyn\", \"name\": \"NACA 2412\", \"re\": 500000, \"polar\": {\"points\": [{\"aoaDeg\": 0, \"cl\": 0.2, \"cd\": 0.008}]}}".encode()
req = Request(
    "https://henfoil.hendoi.com/api/v1/polars/export",
    data=payload,
    headers={
        "Authorization": "Bearer hfk_demo_4c91e2ab8d07",
        "Content-Type": "application/json",
    },
    method="POST",
)
with urlopen(req) as res:
    print(res.status)
    print(json.load(res))

Send it in PHP

The array is the payload. json_encode turns it into JSON. Change a value in the array. CURLINFO_HTTP_CODE is the status. $body is the response text, whether the status is 200 or 400.

$payload = json_encode([
    "format" => "aerodyn",
    "name" => "NACA 2412",
    "re" => 500000,
    "polar" => [
        "points" => [
            [
                "aoaDeg" => 0,
                "cl" => 0.2,
                "cd" => 0.008
            ]
        ]
    ]
]);
$ch = curl_init("https://henfoil.hendoi.com/api/v1/polars/export");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => $payload,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer hfk_demo_4c91e2ab8d07",
        "Content-Type: application/json",
    ],
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), "\n", $body;
curl_close($ch);

Send it in Java

The body string is the JSON payload. Edit the values in that string. statusCode() is the HTTP code and body() is the response text. A rejected call still returns both.

var client = java.net.http.HttpClient.newHttpClient();
var body = "{\"format\": \"aerodyn\", \"name\": \"NACA 2412\", \"re\": 500000, \"polar\": {\"points\": [{\"aoaDeg\": 0, \"cl\": 0.2, \"cd\": 0.008}]}}";
var request = java.net.http.HttpRequest.newBuilder()
    .uri(java.net.URI.create("https://henfoil.hendoi.com/api/v1/polars/export"))
    .header("Authorization", "Bearer hfk_demo_4c91e2ab8d07")
    .header("Content-Type", "application/json")
    .method("POST", java.net.http.HttpRequest.BodyPublishers.ofString(body))
    .build();
var response = client.send(request, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());

Write a Selig coordinate file

POST https://henfoil.hendoi.com/api/v1/airfoils/export

Before you call this API

  • You have an active HENDOI account and a live HENFOIL API key (hfk_…).
  • You know which plan meters this call spends (automation apiRequests, and often polars, optimize, or compute credits).
  • You have either a stored airfoilId, a NACA code, or coordinate / .dat text ready when the endpoint needs geometry.
  • You will treat every numeric sample on this page as a shape guide, not as measured flight data.

Request syntax

Every call has the same four parts. Fill them in this order.

  1. Method. POST.
  2. URL. https://henfoil.hendoi.com/api/v1/airfoils/export. The host is the production API. Do not change it.
  3. Header. Authorization: Bearer hfk_demo_4c91e2ab8d07. Replace the dummy key with the key from Settings, then API, then Generate now. You can send the raw key in X-Henfoil-Key instead, with no Bearer prefix.
  4. Body. One JSON object, with header Content-Type: application/json.

Step by step

Follow this guide in order. Each step says what to type, where it goes, and what to check next. After the last step, compare your HTTP status with the accepted body and the rejected bodies further down.

  1. Before you start. Sign in at https://hendoi.com/login, open HENFOIL, then Settings → API → Generate now. Copy the full hfk_… key once. Confirm your plan still has usage remaining for automation calls.
  2. Confirm the endpoint. You will send POST to https://henfoil.hendoi.com/api/v1/airfoils/export. Keep the production host. Do not point samples at localhost in a shipped integration.
  3. Attach the key. Prefer Authorization: Bearer hfk_…. Or send the raw key in X-Henfoil-Key with no Bearer prefix. Never put the key in the JSON body or in a query string.
  4. Build one JSON object. Add header Content-Type: application/json. Numbers stay numbers (no quotes). Strings stay quoted. Omit optional keys when you want the server default.
  5. Choose exactly one geometry source. Send airfoilId (from Generate), or naca (four digits), or coordinates (closed outline), or text (Selig/Lednicer .dat). Do not combine them in one request.
  6. Set airfoilId. Required (One of these). Example value: 3f2a8c10-6b4e-4d21-9a77-1c0e5b8d2f44. Stored section id returned by Generate.
  7. Set naca. Required (One of these). Example value: 2412. Four digits. The server builds the section. Optional points defaults to 160.
  8. Set coordinates. Required (One of these). Example value: [{x,y}, ...]. At least 8 points, chord near 1, upper surface then lower surface.
  9. Set text. Required (One of these). Example value: Selig .dat text. Coordinate file text. The importer normalizes the chord.
  10. Optionally set format. Example: selig. selig and dat are the same file. Also lednicer, csv, xfoil, xflr5-xml. Omit the key to keep the server default.
  11. Optionally set name. Example: NACA 2412. First line and download name. Default HENFOIL. Omit the key to keep the server default.
  12. Send geometry and format selig.
  13. name is the first line of the file.
  14. Read content, filename, and mimeType.
  15. Send the request. Use any of the six language samples below. Expect HTTP 200 when the call matches this page's accepted example (or HTTP 202 with jobId when a long solve is queued).
  16. Read the JSON by name. On success, start with format, filename, mimeType, content. Ignore sample coefficient magnitudes — they are placeholders for field names only.
  17. Handle failure before success fields. If status is 400, 401, or 403, read error (and meter on 403). Do not parse lift or drag from an error body.
  18. Verify before the next call. Confirm status, remaining automation budget (X-Henfoil-Api-Remaining or GET /api/v1/usage), and that honesty / gate fields (when present) match what you expect for a screening result — not a certification claim.
  19. If you are stuck. Copy the HTTP status and the full error string, then use the contact block at the bottom of this page (WhatsApp or support@hendoi.com).

Quick checklist

  • □ Method is POST and URL path is exact.
  • □ Live API key is in the Authorization (or X-Henfoil-Key) header.
  • □ JSON body uses the field names in the parameters table; types match (number vs string).
  • □ Client branches on HTTP status before reading aerodynamic fields.
  • □ Error path logs error / meter for support.

Parameters

Required means the server needs that field. Optional means a default is already in place. One of these means you send exactly one of the listed geometry fields.

FieldRequiredExampleMeaning
airfoilIdOne of these3f2a8c10-6b4e-4d21-9a77-1c0e5b8d2f44Stored section id returned by Generate.
nacaOne of these2412Four digits. The server builds the section. Optional points defaults to 160.
coordinatesOne of these[{x,y}, ...]At least 8 points, chord near 1, upper surface then lower surface.
textOne of theseSelig .dat textCoordinate file text. The importer normalizes the chord.
formatNoseligselig and dat are the same file. Also lednicer, csv, xfoil, xflr5-xml.
nameNoNACA 2412First line and download name. Default HENFOIL.

How to fill the payload

Treat the payload as a form. Each name is a JSON key. Send numbers as numbers, without quotes. Send text in quotes. Omit an optional key when you want the server default. Send exactly one geometry source when the table says the field is one of a set.

  • airfoilId — One of these. Example: 3f2a8c10-6b4e-4d21-9a77-1c0e5b8d2f44. Stored section id returned by Generate.
  • naca — One of these. Example: 2412. Four digits. The server builds the section. Optional points defaults to 160.
  • coordinates — One of these. Example: [{x,y}, ...]. At least 8 points, chord near 1, upper surface then lower surface.
  • text — One of these. Example: Selig .dat text. Coordinate file text. The importer normalizes the chord.
  • format — Optional. Example: selig. selig and dat are the same file. Also lednicer, csv, xfoil, xflr5-xml.
  • name — Optional. Example: NACA 2412. First line and download name. Default HENFOIL.

The example object below is the body to send. It uses airfoilId, format, name. Copy it, replace the dummy values with yours, and send it with Content-Type: application/json.

Example request

The key hfk_demo_4c91e2ab8d07 is a dummy. It is not a live key, and the server rejects it. Replace it before you send the call. The other values are dummy parameters in the same shape the server reads, so you can see where each number goes.

{
  "airfoilId": "3f2a8c10-6b4e-4d21-9a77-1c0e5b8d2f44",
  "format": "selig",
  "name": "NACA 2412"
}

If the request is accepted

HTTP 200 means the key was accepted and this call finished. Read the status in your client first, then parse the JSON. The numbers below are placeholders so you can see the field names. A live response replaces them. Do not treat this sample as a measured result.

{
  "format": "selig",
  "filename": "NACA_2412.dat",
  "mimeType": "text/plain",
  "content": "NACA 2412\n1.0 0.0\n"
}

Read the body by name:

  • format — text, such as an id, a name, or a message.
  • filename — text, such as an id, a name, or a message.
  • mimeType — text, such as an id, a name, or a message.
  • content — text, such as an id, a name, or a message.

If the request is not accepted

A rejected call is still JSON. Read the HTTP status, then the error string. Do not look for lift or drag fields in these bodies. Fix the named problem and send the same call again.

HTTP 400, missing or unusable input. The message changes with the field. The shape does not:

{
  "error": "Provide coordinates, text, or airfoilId."
}

HTTP 401, missing, unknown, or deactivated key. No automation call is spent:

{
  "error": "This API key is deactivated or was not recognized. Only an active key can call the API."
}

HTTP 403, a meter is used up. meter tells you which one. apiRequests is the automation budget. apiKeyAllocation is the calls assigned to this key:

{
  "error": "API usage limit reached.",
  "code": "QUOTA_EXCEEDED",
  "plan": "student",
  "upgradeTo": "professional",
  "pricingPath": "/pricing",
  "meter": "apiRequests",
  "used": 500,
  "limit": 500,
  "remaining": 0
}

When something goes wrong

  • HTTP 400 Provide coordinates, text, or airfoilId. Send one geometry field.
  • HTTP 401: the key is missing, unknown, or deactivated. No call is spent. Generate a new key and send that value.
  • HTTP 403 with code QUOTA_EXCEEDED: read meter. apiRequests is the automation budget. apiKeyAllocation is this key's assigned calls. The other meter names are the platform limit named in the message.
  • HTTP 400: read error. It names the missing field or the geometry problem. Fix that field and send the call again.
  • HTTP 202 with jobId: the solve is queued. Poll Jobs and usage until status is COMPLETED, COMPLETED_WITH_WARNINGS, FAILED, or CANCELLED. Then GET the job without partial=1.

How each language returns a bad response

  • cURL. The body prints first. The last line from -w is the HTTP status. 400 still prints a JSON body.
  • Node.js. fetch does not throw on 400, 401, or 403. Branch on res.status, then read data.error.
  • C#. GetAsync and PostAsync do not throw on those statuses. Read StatusCode, then the body string.
  • Python. urlopen raises urllib.error.HTTPError. The status is e.code. The JSON is e.read().decode().
  • PHP. curl_exec returns the body for a 400. The status is CURLINFO_HTTP_CODE. A 400 means the server answered.
  • Java. send returns the status and the body together. A 400 does not throw.
import json
from urllib.error import HTTPError
from urllib.request import urlopen
# req is the Request built in the Python sample below.
try:
    with urlopen(req) as res:
        print(res.status)
        print(json.load(res))
except HTTPError as e:
    print(e.code)
    print(json.loads(e.read().decode()))

Useful tips

  • Replace the dummy key before the first real call. A 401 on the sample key is expected.
  • Send one geometry source. Sending airfoilId together with naca or coordinates makes the result harder to trace. Pick one.
  • Check the HTTP status before you read any coefficient. An error body has error, not a polar.
  • Read X-Henfoil-Api-Remaining before a loop. X-Henfoil-Api-Warning appears when fewer than one fifth of the calls remain.
  • Copy a sample with the Copy button, then change only the values you intend to change. Leave the key names as written.
  • If the error text does not match the body you sent, contact us with the status code and that text. The link is at the bottom of this page.

Samples

The six programs below send the same method, URL, header, and payload. The paragraph above each program says which line is the payload and which line is the response.

Send it in cURL

The payload is the JSON in single quotes after -d. Edit the values there. Keep Content-Type: application/json. Replace the dummy key. -w prints the HTTP status after the body.

curl -s -X POST \
  "https://henfoil.hendoi.com/api/v1/airfoils/export" \
  -H "Authorization: Bearer hfk_demo_4c91e2ab8d07" \
  -H "Content-Type: application/json" \
  -d '{"airfoilId":"3f2a8c10-6b4e-4d21-9a77-1c0e5b8d2f44","format":"selig","name":"NACA 2412"}' \
  -w "\n%{http_code}\n"

Send it in Node.js

The object inside JSON.stringify is the payload. Change a property there; do not build the JSON by hand. fetch does not throw on 400 or 403. Read res.status, then data.error when the status is not 200.

const res = await fetch("https://henfoil.hendoi.com/api/v1/airfoils/export", {
  method: "POST",
  headers: {
    Authorization: "Bearer hfk_demo_4c91e2ab8d07",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({"airfoilId": "3f2a8c10-6b4e-4d21-9a77-1c0e5b8d2f44", "format": "selig", "name": "NACA 2412"})
});
const data = await res.json();
console.log(res.status, data);

Send it in C#

The string passed to StringContent is the JSON payload. Edit the values inside that string and keep the escaped quotes. StatusCode is the HTTP code. The following string is the raw response, success or error.

using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", "hfk_demo_4c91e2ab8d07");
var content = new StringContent(
    "{\"airfoilId\": \"3f2a8c10-6b4e-4d21-9a77-1c0e5b8d2f44\", \"format\": \"selig\", \"name\": \"NACA 2412\"}", Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://henfoil.hendoi.com/api/v1/airfoils/export", content);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());

Send it in Python

payload is the JSON text, then encoded to bytes. Edit the text inside the quotes. On 200, res.status and json.load show the accepted body. On 400, 401, or 403, urlopen raises HTTPError and the JSON is in e.read().

import json
from urllib.request import Request, urlopen
payload = "{\"airfoilId\": \"3f2a8c10-6b4e-4d21-9a77-1c0e5b8d2f44\", \"format\": \"selig\", \"name\": \"NACA 2412\"}".encode()
req = Request(
    "https://henfoil.hendoi.com/api/v1/airfoils/export",
    data=payload,
    headers={
        "Authorization": "Bearer hfk_demo_4c91e2ab8d07",
        "Content-Type": "application/json",
    },
    method="POST",
)
with urlopen(req) as res:
    print(res.status)
    print(json.load(res))

Send it in PHP

The array is the payload. json_encode turns it into JSON. Change a value in the array. CURLINFO_HTTP_CODE is the status. $body is the response text, whether the status is 200 or 400.

$payload = json_encode([
    "airfoilId" => "3f2a8c10-6b4e-4d21-9a77-1c0e5b8d2f44",
    "format" => "selig",
    "name" => "NACA 2412"
]);
$ch = curl_init("https://henfoil.hendoi.com/api/v1/airfoils/export");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => $payload,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer hfk_demo_4c91e2ab8d07",
        "Content-Type: application/json",
    ],
]);
$body = curl_exec($ch);
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), "\n", $body;
curl_close($ch);

Send it in Java

The body string is the JSON payload. Edit the values in that string. statusCode() is the HTTP code and body() is the response text. A rejected call still returns both.

var client = java.net.http.HttpClient.newHttpClient();
var body = "{\"airfoilId\": \"3f2a8c10-6b4e-4d21-9a77-1c0e5b8d2f44\", \"format\": \"selig\", \"name\": \"NACA 2412\"}";
var request = java.net.http.HttpRequest.newBuilder()
    .uri(java.net.URI.create("https://henfoil.hendoi.com/api/v1/airfoils/export"))
    .header("Authorization", "Bearer hfk_demo_4c91e2ab8d07")
    .header("Content-Type", "application/json")
    .method("POST", java.net.http.HttpRequest.BodyPublishers.ofString(body))
    .build();
var response = client.send(request, java.net.http.HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());

Related pages

If you are unsure, contact us

You do not have to guess the payload. Call or WhatsApp +91-9677261485. The message already names this page. Or email support@hendoi.com. Paste the HTTP status and the error text from the response so we can answer from the same request you sent.

Contact us if you are stuck

Call or WhatsApp +91-9677261485. The message already names this page. Or email support@hendoi.com. Paste the HTTP status and the error text from the response.

Call usChat with us