Get an analysis request
curl --request GET \
--url https://api.halal.sh/v1/analysis-requests/{request_id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.halal.sh/v1/analysis-requests/{request_id}"
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.halal.sh/v1/analysis-requests/{request_id}', 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.halal.sh/v1/analysis-requests/{request_id}",
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.halal.sh/v1/analysis-requests/{request_id}"
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.halal.sh/v1/analysis-requests/{request_id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.halal.sh/v1/analysis-requests/{request_id}")
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{
"data": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"instrument_id": "TYO:7203",
"status": "queued",
"lane": "priority",
"requested_at": "2023-11-07T05:31:56Z",
"promised_by": "2023-11-07T05:31:56Z",
"scheduled_for": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"progress_percentage": 50,
"determination": "compliant",
"notify": true,
"links": {
"self": "/v1/analysis-requests/6f1c2d4e-0000-4000-8000-000000000001",
"compliance": "/v1/instruments/TYO:7203/compliance"
}
},
"meta": {
"request_id": "req_abc123",
"as_of": "2023-11-07T05:31:56Z",
"methodology": "aaoifi-ss21@2026.1"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or revoked API key."
},
"meta": {
"request_id": "req_abc123"
}
}{
"error": {
"code": "not_found",
"message": "Stock with identifier 'XYZ' not found"
},
"meta": {
"request_id": "req_abc123"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Daily limit of 100 requests reached. It resets at midnight UTC. The Plus plan includes up to 2,000 requests a day on every stock and ETF we cover, for $7 a month: https://halal.sh/plans?source=api_refusal. To show results in your own product, you need the Developer plan, at $99 a month: https://halal.sh/developers.",
"retry_after": 3600,
"upgrade": {
"plan": "plus",
"price_usd_monthly": 7,
"url": "https://halal.sh/plans?source=api_refusal",
"commercial_plan": "developer",
"commercial_price_usd_monthly": 99,
"commercial_url": "https://halal.sh/developers"
}
},
"meta": {
"request_id": "req_abc123"
}
}Analysis requests
Get an Analysis Request
Where a requested analysis stands. Only the account that made the
request, or one that joined it, can read it; any other id gets
404.
Poll every minute or two. A scheduled request won’t start before
scheduled_for, so poll it less often until then. When status is
complete, determination has the published status and
links.compliance the full result. A request still under_review
after promised_by is with our team. If you sent "notify": true, we
will email the account when we publish the result, so you can stop
polling then.
GET
/
analysis-requests
/
{request_id}
Get an analysis request
curl --request GET \
--url https://api.halal.sh/v1/analysis-requests/{request_id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.halal.sh/v1/analysis-requests/{request_id}"
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.halal.sh/v1/analysis-requests/{request_id}', 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.halal.sh/v1/analysis-requests/{request_id}",
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.halal.sh/v1/analysis-requests/{request_id}"
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.halal.sh/v1/analysis-requests/{request_id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.halal.sh/v1/analysis-requests/{request_id}")
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{
"data": {
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"instrument_id": "TYO:7203",
"status": "queued",
"lane": "priority",
"requested_at": "2023-11-07T05:31:56Z",
"promised_by": "2023-11-07T05:31:56Z",
"scheduled_for": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"progress_percentage": 50,
"determination": "compliant",
"notify": true,
"links": {
"self": "/v1/analysis-requests/6f1c2d4e-0000-4000-8000-000000000001",
"compliance": "/v1/instruments/TYO:7203/compliance"
}
},
"meta": {
"request_id": "req_abc123",
"as_of": "2023-11-07T05:31:56Z",
"methodology": "aaoifi-ss21@2026.1"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or revoked API key."
},
"meta": {
"request_id": "req_abc123"
}
}{
"error": {
"code": "not_found",
"message": "Stock with identifier 'XYZ' not found"
},
"meta": {
"request_id": "req_abc123"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "Daily limit of 100 requests reached. It resets at midnight UTC. The Plus plan includes up to 2,000 requests a day on every stock and ETF we cover, for $7 a month: https://halal.sh/plans?source=api_refusal. To show results in your own product, you need the Developer plan, at $99 a month: https://halal.sh/developers.",
"retry_after": 3600,
"upgrade": {
"plan": "plus",
"price_usd_monthly": 7,
"url": "https://halal.sh/plans?source=api_refusal",
"commercial_plan": "developer",
"commercial_price_usd_monthly": 99,
"commercial_url": "https://halal.sh/developers"
}
},
"meta": {
"request_id": "req_abc123"
}
}
