POST /api/panjiva/shipments/statistics
Price: 5 credits
Totals over every US customs import record matching a free-text query, optionally narrowed to shippers or US buyers within a radius of a point: how many shipments, their combined weight in kilograms and declared value in US dollars, plus an optional breakdown of them across chosen attributes such as origin country, port of unlading, industry or consignee country.
Use it for market-sizing questions — how much of a product or a company's trade moves and where from. The totals cover every matching customs record, but a breakdown covers only the shipments whose attribute the source knows, on some attributes under a tenth of them, so read covered_shipment_count against shipment_count before treating a distribution as a share of the whole. A dimension whose fetch fails is left out instead of costing you the totals, so match the dimension each breakdown echoes against the ones you asked for before assuming all of them came back. A query nothing matches answers null totals rather than an error.
access-token string requiredtimeout integer — Max scrapping execution timeout (in seconds) (default: 300; min: 20; max: 1500)shipper_latitude number nullable — Latitude of the point the foreign shipper must sit near; send it together with shipper_longitude and shipper_radius_km (examples: 31.2304; min: -90; max: 90)shipper_longitude number nullable — Longitude of that same point (examples: 121.4737; min: -180; max: 180)shipper_radius_km integer nullable — How far from that point, in kilometres, the shipper may be; Panjiva's own map offers 10 to 1000 (examples: 50; min: 1; max: 5000)consignee_latitude number nullable — Latitude of the point the US buyer must sit near; send it together with consignee_longitude and consignee_radius_km (examples: 40.7128; min: -90; max: 90)consignee_longitude number nullable — Longitude of that same point (examples: -74.006; min: -180; max: 180)consignee_radius_km integer nullable — How far from that point, in kilometres, the buyer may be; Panjiva's own map offers 10 to 1000 (examples: 50; min: 1; max: 5000)query string nullable — Free text matched against goods descriptions, company names, addresses and HS codes; omit it to measure every US import record (examples: "furniture", "Walmart", "9401"; minLength: 1)dimensions array — Attributes to break the matching shipments down by; each one adds its own distribution of values and counts (default: []; one of: "origin_countries", "shipment_destination", "port_of_unlading", "us_destination_port", "port_of_lading", "bill_type", "industry_gics", "intra_company", "shipper_state", "shipper_industry", "shipper_employee_count", "shipper_revenue", "shipper_market_cap", "shipper_ownership", "shipper_bidirectional_trade", "shipper_stock_ticker", "shipper_ultimate_parent_stock_ticker", "consignee_country", "consignee_state", "consignee_industry", "consignee_employee_count", "consignee_revenue", "consignee_market_cap", "consignee_ownership", "consignee_bidirectional_trade", "consignee_stock_ticker", "consignee_ultimate_parent_stock_ticker"; examples: ["origin_countries","port_of_unlading"])@type string (default: "PanjivaShipmentStatistics")url string requiredquery string nullableshipment_count integer nullableweight_kg number nullablevalue_usd number nullablebreakdowns array (default: [])@type string (default: "PanjivaShipmentBreakdown")dimension string required (one of: "origin_countries", "shipment_destination", "port_of_unlading", "us_destination_port", "port_of_lading", "bill_type", "industry_gics", "intra_company", "shipper_state", "shipper_industry", "shipper_employee_count", "shipper_revenue", "shipper_market_cap", "shipper_ownership", "shipper_bidirectional_trade", "shipper_stock_ticker", "shipper_ultimate_parent_stock_ticker", "consignee_country", "consignee_state", "consignee_industry", "consignee_employee_count", "consignee_revenue", "consignee_market_cap", "consignee_ownership", "consignee_bidirectional_trade", "consignee_stock_ticker", "consignee_ultimate_parent_stock_ticker")covered_shipment_count integer nullablevalues array (default: [])@type string (default: "PanjivaShipmentBreakdownValue")value string requiredkey string nullablegroups array (default: [])shipment_count integer nullable422 — The request body did not validate Check the fields against this schema. A URN with the wrong prefix is the most common cause.408 — The request ran past its time limit Raise `timeout` in the request body, up to the maximum this endpoint documents. Lowering `count` or turning off the `with_*` flags also helps, because less work finishes sooner.412 — The entity was not found, or a precondition failed Retrying will not help: either the entity does not exist, or the input points at a different one.429 — Too many requests: a rate limit or a usage window is exhausted When the response carries an X-Retry-After header, wait that many seconds and retry: the same number is in the body as `detail.retry_after`, and the limit clears once that window passes. The message in the body names the limit that was hit.500 — Something broke on our side Retrying will not help. If it keeps happening, send us the X-Request-ID from the response headers.529 — Rate limit reached, or the endpoint is overloaded Wait at least 30 seconds, then retry.X-Error — Error message text (present only on error)X-Request-ID — Unique request identifierX-Execution-Time — Execution time in secondsX-Result-Count — How many records the body carries. 0 means an empty result, which is a normal answer and not by itself an error. A non-zero count can come back together with X-Error when the failure happened partway through — read this header and X-Error independently.X-Total-Available-Results — How many records exist for this query, when the endpoint can say. On a `dry_run` request this is the answer and the body is empty. It saturates: the endpoint's documented maximum means 'at least that many', any smaller number is exact.X-Warning — Present when the request body carried keys this endpoint does not document. They were ignored, so any filter you meant to apply through them did not apply. Check the spelling against this schema and retry.X-Retry-After — Seconds to wait before retrying. Present only on 429.