POST
https://api.milda.ai/v1/trade-data/analyticsTrade Analytics
application/json01
Description
Trade Data — Analytics
POST /v1/trade-data/analytics
Step 2 of trade data. Returns an aggregated import/export trade report for a selected candidate.
Request
company_id(required) — Company ID.candidate_id(required) — from acandidatesresult.type(required) —imp(imports) orexp(exports).
Response
summary—total_shipments,total_importers,total_suppliers,total_import_countries,total_export_countriestop_10_importer_countries/top_10_exporter_countries— each item:rank,country {name, code, name_cn},total_value,total_shipments,total_quantity,total_weight
Returns 204 No Content if there is no report for the company.
Credits
Charged a flat fee per report (data credits).
02
Headers
nameinreqdescription
tokenheaderone ofYour API token, sent as "token: YOUR_API_TOKEN". Send this or Authorization.
Authorizationheaderone ofThe same token in the standard form, sent as "Authorization: Bearer YOUR_API_TOKEN" (the word Bearer, a space, then your token). Send this or token.
03
Request body
TradeAnalyticsRequestTradeAnalyticsRequesttypereq3 fields
company_idstringyesCompany ID.
candidate_idstringyescandidate_id from a candidates result.
type"imp" | "exp"yes'imp' for imports, 'exp' for exports.
04
Responses
200 Successful Response422 Validation Error
TradeReporttype3 fields
+summaryTradeSummary | null
total_shipmentsinteger | null
total_importersinteger | null
total_suppliersinteger | null
total_import_countriesinteger | null
total_export_countriesinteger | null
+top_10_importer_countriesTopCountryItem[]
rankinteger | null
+countryTradeCountry | null
namestring | null
codestring | null
name_cnstring | null
total_valuenumber | null
total_shipmentsinteger | null
total_quantitynumber | null
total_weightnumber | null
+top_10_exporter_countriesTopCountryItem[]
rankinteger | null
+countryTradeCountry | null
namestring | null
codestring | null
name_cnstring | null
total_valuenumber | null
total_shipmentsinteger | null
total_quantitynumber | null
total_weightnumber | null