Setup¶
Install the Signal Ocean SDK:
pip install signal-ocean
Subscribe to the Companies API at https://apis.signalocean.com/ to get a subscription key. Use the key to configure your connection to the API:
In [1]:
Copied!
pip install signal-ocean
pip install signal-ocean
In [2]:
Copied!
from signal_ocean.companies import CompaniesAPI
import pandas as pd
from signal_ocean import Connection
subscription_key = "" # paste your subscription key here
connection = Connection(subscription_key)
from signal_ocean.companies import CompaniesAPI
import pandas as pd
from signal_ocean import Connection
subscription_key = "" # paste your subscription key here
connection = Connection(subscription_key)
Call the Companies API¶
The Companies API retrieves information about companies.
In [3]:
Copied!
api = CompaniesAPI(connection)
api = CompaniesAPI(connection)
Get company by id¶
In [4]:
Copied!
company_id = 1926
c = api.get_company(company_id)
print(f'Company {company_id}: {c.company_name} ({c.website})')
company_id = 1926
c = api.get_company(company_id)
print(f'Company {company_id}: {c.company_name} ({c.website})')
Company 1926: Signal Maritime (http://signalmaritime.com/)
Get details for all companies¶
In [5]:
Copied!
companies = api.get_companies()
companies = api.get_companies()
In [6]:
Copied!
len(companies)
len(companies)
Out[6]:
4492
In [7]:
Copied!
df = pd.DataFrame([x.__dict__ for x in companies])
df = pd.DataFrame([x.__dict__ for x in companies])
In [8]:
Copied!
df.columns
df.columns
Out[8]:
Index(['id', 'updated_date', 'company_name', 'website', 'fleet_list', 'synonyms', 'charterer_vessel_types', 'commercial_operator_vessel_types', 'geo_asset_owner_vessel_types', 'broker_vessel_types', 'port_agent_vessel_types', 'parent_company_id', 'children_companies_ids'], dtype='object')
In [9]:
Copied!
df.head(10)
df.head(10)
Out[9]:
id | updated_date | company_name | website | fleet_list | synonyms | charterer_vessel_types | commercial_operator_vessel_types | geo_asset_owner_vessel_types | broker_vessel_types | port_agent_vessel_types | parent_company_id | children_companies_ids | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 3 | 2018-06-22 14:09:27.793000+00:00 | Abiola Shipping | http://www.equasis.org/EquasisWeb/restricted/C... | None | None | None | (Tanker,) | None | None | None | NaN | None |
1 | 5 | 2018-08-08 09:39:21.360000+00:00 | Abu Dhabi | https://adnoc.ae/adnoc-onshore/notification | None | None | None | None | (Tanker,) | None | None | NaN | None |
2 | 6 | 2016-10-31 16:32:56.757000+00:00 | Abu Dhabi Gas Industries | http://www.gasco.ae/en/Pages/Index.aspx | None | (Gasco,) | None | None | (Tanker,) | None | None | NaN | None |
3 | 7 | 2016-10-31 16:32:56.757000+00:00 | Abu Dhabi Marine Operating Company | http://www.adma-opco.com/en/home/index.aspx?&P... | None | (ADMA-OPCO,) | None | None | (Tanker,) | None | None | NaN | None |
4 | 8 | 2016-10-31 16:32:56.757000+00:00 | Abu Dhabi Oil Company | http://adocauh.cts-co.net/ | None | (ADOC,) | (Tanker,) | None | (Tanker,) | None | None | NaN | None |
5 | 9 | 2016-10-31 16:39:13.283000+00:00 | Abu Dubai Oil Refining Company | http://www.takreer.com/index.html | None | (TAKREER,) | None | None | (Tanker,) | None | None | NaN | None |
6 | 10 | 2016-10-31 16:32:56.757000+00:00 | Aca Sa | http://www.acacitv.com/ | None | None | None | None | (Tanker,) | None | None | NaN | None |
7 | 12 | 2016-10-31 16:32:56.757000+00:00 | Ace Tankers | http://www.ace-tankers.com/ | http://www.ace-tankers.com/fleet.html | None | None | (Tanker,) | None | None | None | NaN | None |
8 | 13 | 2016-10-31 16:32:56.757000+00:00 | Aceitera General | https://www.agd.com.ar/en/home/ | None | (AGD,) | (Tanker,) | None | None | None | None | NaN | None |
9 | 16 | 2016-12-23 17:55:50.580000+00:00 | Achema Group | http://www.achemosgrupe.lt/en/who-we-are/ | None | None | None | None | (Tanker,) | None | None | NaN | None |
Get all companies the name of which contains the term Maritime¶
In [10]:
Copied!
companies = api.get_companies('maritime')
companies = api.get_companies('maritime')
In [11]:
Copied!
len(companies)
len(companies)
Out[11]:
184
In [12]:
Copied!
df = pd.DataFrame([x.__dict__ for x in companies])
df = pd.DataFrame([x.__dict__ for x in companies])
In [13]:
Copied!
df.head(10)
df.head(10)
Out[13]:
id | updated_date | company_name | website | fleet_list | synonyms | charterer_vessel_types | commercial_operator_vessel_types | geo_asset_owner_vessel_types | broker_vessel_types | port_agent_vessel_types | parent_company_id | children_companies_ids | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 43 | 2016-10-31 16:32:56.757000+00:00 | Al Rekab Global Maritime | http://marbnet.com/directory/listing/al-rekab-... | None | None | None | (Tanker,) | None | None | None | NaN | None |
1 | 53 | 2019-07-30 11:25:15.727000+00:00 | Alma Maritime | http://www.almamaritime.com/ | http://www.almamaritime.com/content/fleet/004/... | None | None | (Tanker, Dry) | None | None | None | NaN | None |
2 | 66 | 2016-10-31 16:32:56.757000+00:00 | Alvan Maritime | https://opencorporates.com/companies/pa/744162 | None | None | None | (Tanker,) | None | None | None | NaN | None |
3 | 81 | 2016-10-31 16:32:56.757000+00:00 | Andros Maritime | http://www.logisticscout.com/company-andros-ma... | None | None | None | (Tanker,) | None | None | None | NaN | None |
4 | 95 | 2018-05-11 08:29:26.513000+00:00 | Arab Maritime Petroleum Transport | http://www.amptc.net/ | http://www.amptc.net/ | (AMPTC,) | None | (Tanker,) | None | None | None | NaN | None |
5 | 118 | 2018-06-27 12:31:03.710000+00:00 | Associated Maritime | http://www.hkmw.com.hk/webappen/main.asp?sid=455 | http://www.hkmw.com.hk/webappen/main3.asp?sid=482 | (AMCL,) | None | (Tanker, Dry) | None | None | None | NaN | (286,) |
6 | 124 | 2016-10-31 16:32:56.757000+00:00 | Atlas Maritime | http://www.atlasmaritime.eu/ | http://www.atlasmaritime.eu/fleet | None | (Tanker,) | None | None | None | None | NaN | None |
7 | 168 | 2016-10-31 16:32:56.757000+00:00 | Belavero Maritime | http://marbnet.com/directory/listing/belavero-... | None | None | None | (Tanker,) | None | None | None | NaN | None |
8 | 203 | 2016-10-31 16:32:56.757000+00:00 | Boray Maritime | http://www.world-ships.com/company/df76f52c5e4... | None | None | None | (Tanker,) | None | None | None | NaN | None |
9 | 226 | 2018-07-06 13:08:51.450000+00:00 | Byzantine Maritime | http://www.bmc.gr/ | http://www.bmc.gr/fleet/Fleet.htm | (BMC,) | None | (Tanker, Dry) | None | None | None | NaN | None |
In [14]:
Copied!
df[df['company_name'].str.startswith('Signal')]
df[df['company_name'].str.startswith('Signal')]
Out[14]:
id | updated_date | company_name | website | fleet_list | synonyms | charterer_vessel_types | commercial_operator_vessel_types | geo_asset_owner_vessel_types | broker_vessel_types | port_agent_vessel_types | parent_company_id | children_companies_ids | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
61 | 1926 | 2018-10-08 12:51:54.213000+00:00 | Signal Maritime | http://signalmaritime.com/ | http://signalmaritime.com/ | None | None | (Tanker, Dry) | None | None | None | NaN | None |