Skip to main content

Embargo | Python SDK

The Pangea Embargo API lets developers quickly check IPs and country codes against known sanction and trade embargo lists.

Initializes a new Pangea service client.

Embargo(token, config, logger_name)

required parameters

str

Pangea API token.

optional parameters

PangeaConfig | None

Configuration.

str

Logger name.

download-file

Embargo.download_file()

Check IP

Embargo.ip_check(ip)

Check an IP against known sanction and trade embargo lists.

required parameters

str

Geolocate this IP and check the corresponding country against the enabled embargo lists. Accepts both IPV4 and IPV6 strings.

Response Object

A PangeaResponse where the sanctioned source(s) are in the response.result field. Available response fields can be found in our API Documentation.

response = embargo.ip_check("190.6.64.94")

ISO Code Check

Embargo.iso_check(iso_code)

Check this country against known sanction and trade embargo lists.

required parameters

str

Check this two character country ISO-code against the enabled embargo lists.

Response Object

A PangeaResponse where the sanctioned source(s) are in the response.result field. Available response fields can be found in our API Documentation.

response = embargo.iso_check("CU")

Poll result

Embargo.poll_result(exception)

Returns request's result that has been accepted by the server

optional parameters

AcceptedRequestException

Exception raise by SDK on the call that is been processed.

Response Object

PangeaResponse

response = service.poll_result(exception)