curl --request POST \
--url https://api.fincept.in/quantlib/numerical/roots/find-1d \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"func_name": "x2_minus_4",
"a": 1,
"b": 3,
"method": "brent",
"tol": 1e-12
}
'import requests
url = "https://api.fincept.in/quantlib/numerical/roots/find-1d"
payload = {
"func_name": "x2_minus_4",
"a": 1,
"b": 3,
"method": "brent",
"tol": 1e-12
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({func_name: 'x2_minus_4', a: 1, b: 3, method: 'brent', tol: 1e-12})
};
fetch('https://api.fincept.in/quantlib/numerical/roots/find-1d', 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.fincept.in/quantlib/numerical/roots/find-1d",
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([
'func_name' => 'x2_minus_4',
'a' => 1,
'b' => 3,
'method' => 'brent',
'tol' => 1e-12
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fincept.in/quantlib/numerical/roots/find-1d"
payload := strings.NewReader("{\n \"func_name\": \"x2_minus_4\",\n \"a\": 1,\n \"b\": 3,\n \"method\": \"brent\",\n \"tol\": 1e-12\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.fincept.in/quantlib/numerical/roots/find-1d")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"func_name\": \"x2_minus_4\",\n \"a\": 1,\n \"b\": 3,\n \"method\": \"brent\",\n \"tol\": 1e-12\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fincept.in/quantlib/numerical/roots/find-1d")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"func_name\": \"x2_minus_4\",\n \"a\": 1,\n \"b\": 3,\n \"method\": \"brent\",\n \"tol\": 1e-12\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"root": 2,
"iterations": 8,
"converged": true,
"function_value": 1.3e-15
}
}{
"detail": "Invalid API key"
}{
"detail": "Endpoint requires Basic tier or higher"
}Find Root of Scalar Function
Find a root (zero) of a scalar function f(x) in the interval [a, b] where f(a) and f(b) have opposite signs. Methods: bisect (reliable, slow convergence), brent (optimal hybrid method, recommended), ridder (exponential convergence), secant (fast but requires good initial bracket). Essential for implied volatility calculation, yield-to-maturity solving, break-even analysis, and finding zeros in pricing equations. [Tier: BASIC, Credits: 1]
curl --request POST \
--url https://api.fincept.in/quantlib/numerical/roots/find-1d \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"func_name": "x2_minus_4",
"a": 1,
"b": 3,
"method": "brent",
"tol": 1e-12
}
'import requests
url = "https://api.fincept.in/quantlib/numerical/roots/find-1d"
payload = {
"func_name": "x2_minus_4",
"a": 1,
"b": 3,
"method": "brent",
"tol": 1e-12
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({func_name: 'x2_minus_4', a: 1, b: 3, method: 'brent', tol: 1e-12})
};
fetch('https://api.fincept.in/quantlib/numerical/roots/find-1d', 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.fincept.in/quantlib/numerical/roots/find-1d",
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([
'func_name' => 'x2_minus_4',
'a' => 1,
'b' => 3,
'method' => 'brent',
'tol' => 1e-12
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.fincept.in/quantlib/numerical/roots/find-1d"
payload := strings.NewReader("{\n \"func_name\": \"x2_minus_4\",\n \"a\": 1,\n \"b\": 3,\n \"method\": \"brent\",\n \"tol\": 1e-12\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.fincept.in/quantlib/numerical/roots/find-1d")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"func_name\": \"x2_minus_4\",\n \"a\": 1,\n \"b\": 3,\n \"method\": \"brent\",\n \"tol\": 1e-12\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fincept.in/quantlib/numerical/roots/find-1d")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"func_name\": \"x2_minus_4\",\n \"a\": 1,\n \"b\": 3,\n \"method\": \"brent\",\n \"tol\": 1e-12\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"root": 2,
"iterations": 8,
"converged": true,
"function_value": 1.3e-15
}
}{
"detail": "Invalid API key"
}{
"detail": "Endpoint requires Basic tier or higher"
}Authorizations
API key for authentication. Get your key at https://api.fincept.in/auth/register
Body
Built-in function or 'custom_poly' for polynomial
sin, cos, exp_minus_2, x2_minus_4, custom_poly "x2_minus_4"
Lower bound of search interval
1
Upper bound of search interval (f(a) and f(b) should have opposite signs)
3
Root-finding method
bisect, brent, ridder, secant "brent"
Convergence tolerance (smaller = more accurate)
1e-12
Polynomial coefficients [a0, a1, a2, ...] for a0 + a1x + a2x^2 + ... (only for custom_poly)
[-4, 0, 1]
