Bigdata provides specialized methods to retrieve company information
using unique market identifiers such as ISIN, CUSIP, SEDOL, or listings.
These methods allow users to directly query the database for relevant
companies based on their identifiers.
Each of these methods accepts a list of strings as input and returns a
list of corresponding company objects or None for identifiers that
cannot be matched. The methods include:
get_companies_by_isin(isins: list[str])
get_companies_by_cusip(cusips: list[str])
get_companies_by_sedol(sedols: list[str])
get_companies_by_listing(listings: list[str])
Examples
Copy
from dotenv import load_dotenvfrom bigdata_client import Bigdataimport osload_dotenv()# Initialize the Bigdata APIusername = os.environ.get("BIGDATA_USERNAME")password = os.environ.get("BIGDATA_PASSWORD")bigdata = Bigdata(username, password)# Fetch companies by ISINsisins = ["US0378331005", "US0231351067", "LU1861138375"]companies_by_isin = bigdata.knowledge_graph.get_companies_by_isin(isins)for isin, company in zip(isins, companies_by_isin): if company: print(f"{company.name}: {company.id}") else: print(f"Company not found for ISIN {isin}")
Output:
Copy
Apple Inc.: D8442AAmazon.com Inc.: 0157B1Company not found for ISIN LU1861138375
Copy
from dotenv import load_dotenvfrom bigdata_client import Bigdataimport osload_dotenv()# Initialize the Bigdata APIusername = os.environ.get("BIGDATA_USERNAME")password = os.environ.get("BIGDATA_PASSWORD")bigdata = Bigdata(username, password)# Fetch companies by ISINsisins = ["US0378331005", "US0231351067", "LU1861138375"]companies_by_isin = bigdata.knowledge_graph.get_companies_by_isin(isins)for isin, company in zip(isins, companies_by_isin): if company: print(f"{company.name}: {company.id}") else: print(f"Company not found for ISIN {isin}")
Output:
Copy
Apple Inc.: D8442AAmazon.com Inc.: 0157B1Company not found for ISIN LU1861138375
Copy
from dotenv import load_dotenvfrom bigdata_client import Bigdataimport osload_dotenv()# Initialize the Bigdata APIusername = os.environ.get("BIGDATA_USERNAME")password = os.environ.get("BIGDATA_PASSWORD")bigdata = Bigdata(username, password)# Fetch companies by CUSIPscusips = ["037833100", "023135106", "023135103"]companies_by_cusip = bigdata.knowledge_graph.get_companies_by_cusip(cusips)for cusip, company in zip(cusips, companies_by_cusip): if company: print(f"{company.name}: {company.id}") else: print(f"Company not found for CUSIP {cusip}")
Output:
Copy
Apple Inc.: D8442AAmazon.com Inc.: 0157B1Company not found for CUSIP 023135103
Copy
from dotenv import load_dotenvfrom bigdata_client import Bigdataimport osload_dotenv()# Initialize the Bigdata APIusername = os.environ.get("BIGDATA_USERNAME")password = os.environ.get("BIGDATA_PASSWORD")bigdata = Bigdata(username, password)# Fetch companies by SEDOLssedols = ["2046251", "2000019", "BNV0000"]companies_by_sedol = bigdata.knowledge_graph.get_companies_by_sedol(sedols)for sedol, company in zip(sedols, companies_by_sedol): if company: print(f"{company.name}: {company.id}") else: print(f"Company not found for SEDOL {sedol}")
Output:
Copy
Apple Inc.: D8442AAmazon.com Inc.: 0157B1Company not found for SEDOL BNV0000
Copy
from dotenv import load_dotenvfrom bigdata_client import Bigdataimport osload_dotenv()# Initialize the Bigdata APIusername = os.environ.get("BIGDATA_USERNAME")password = os.environ.get("BIGDATA_PASSWORD")bigdata = Bigdata(username, password)# Listing is the combination of the Market Identifier Code (MIC) and company ticker separated by the character ":", e.g: "XNAS:META"listings = ["XNAS:AAPL", "XNAS:AMZN", "XNAS:AAAA"]companies_by_listing = bigdata.knowledge_graph.get_companies_by_listing(listings)for listing, company in zip(listings, companies_by_listing): if company: print(f"{company.name}: {company.id}") else: print(f"Company not found for listing {listing}")
Output:
Copy
Apple Inc.: D8442AAmazon.com Inc.: 0157B1Company not found for listing XNAS:AAAA
These methods raise a TypeError if the input is not a list of strings,
ensuring users provide valid data.
The method find_companies returns a list of companies that matched the value parameter.
The value can match with the company’s name, webpage, ticker, or any market identifers.
Copy
from dotenv import load_dotenvfrom bigdata_client import Bigdataimport osload_dotenv()# Initialize the Bigdata APIusername = os.environ.get("BIGDATA_USERNAME")password = os.environ.get("BIGDATA_PASSWORD")bigdata = Bigdata(username, password)results = bigdata.knowledge_graph.find_companies("Pfizer")for company in results: print(f"Entity ID: {company.id}") print(f"Company Name: {company.name}") print(f"Country: {company.country}") print(f"Description: {company.description}") print(f"Website: {company.webpage}") print(f"Ticker: {company.ticker}\n")
Output:
Copy
Entity ID: 267718Company Name: Pfizer Inc.Country: United StatesDescription: Pfizer Inc. is an American multinational pharmaceutical corporation headquartered in New York City, and with its research headquarters in Groton, Connecticut, United States. The company was founded in 1849.Website: http://www.pfizer.comTicker: PFEEntity ID: 0CC745Company Name: Pfizer India Ltd.Country: IndiaDescription: Pfizer India Ltd. was formed in November 21, 1950, after Pfizer's acquisition of Dumex. It is a 40% owned subsidiary of Pfizer Inc.Website: http://www.pfizerltd.co.inTicker: 500680...
Copy
from dotenv import load_dotenvfrom bigdata_client import Bigdataimport osload_dotenv()# Initialize the Bigdata APIusername = os.environ.get("BIGDATA_USERNAME")password = os.environ.get("BIGDATA_PASSWORD")bigdata = Bigdata(username, password)results = bigdata.knowledge_graph.find_companies("Pfizer")for company in results: print(f"Entity ID: {company.id}") print(f"Company Name: {company.name}") print(f"Country: {company.country}") print(f"Description: {company.description}") print(f"Website: {company.webpage}") print(f"Ticker: {company.ticker}\n")
Output:
Copy
Entity ID: 267718Company Name: Pfizer Inc.Country: United StatesDescription: Pfizer Inc. is an American multinational pharmaceutical corporation headquartered in New York City, and with its research headquarters in Groton, Connecticut, United States. The company was founded in 1849.Website: http://www.pfizer.comTicker: PFEEntity ID: 0CC745Company Name: Pfizer India Ltd.Country: IndiaDescription: Pfizer India Ltd. was formed in November 21, 1950, after Pfizer's acquisition of Dumex. It is a 40% owned subsidiary of Pfizer Inc.Website: http://www.pfizerltd.co.inTicker: 500680...
Copy
from dotenv import load_dotenvfrom bigdata_client import Bigdataimport osload_dotenv()# Initialize the Bigdata APIusername = os.environ.get("BIGDATA_USERNAME")password = os.environ.get("BIGDATA_PASSWORD")bigdata = Bigdata(username, password)results = bigdata.knowledge_graph.find_companies("PFE")for company in results: print(f"Entity ID: {company.id}") print(f"Company Name: {company.name}") print(f"Country: {company.country}") print(f"Description: {company.description}") print(f"Website: {company.webpage}") print(f"Ticker: {company.ticker}\n")
Output:
Copy
Entity ID: 267718Company Name: Pfizer Inc.Country: United StatesDescription: Pfizer Inc. is an American multinational pharmaceutical corporation headquartered in New York City, and with its research headquarters in Groton, Connecticut, United States. The company was founded in 1849.Website: http://www.pfizer.comTicker: PFE...
Copy
from dotenv import load_dotenvfrom bigdata_client import Bigdataimport osload_dotenv()# Initialize the Bigdata APIusername = os.environ.get("BIGDATA_USERNAME")password = os.environ.get("BIGDATA_PASSWORD")bigdata = Bigdata(username, password)results = bigdata.knowledge_graph.find_companies("http://www.pfizer.com")for company in results: print(f"Entity ID: {company.id}") print(f"Company Name: {company.name}") print(f"Country: {company.country}") print(f"Description: {company.description}") print(f"Website: {company.webpage}") print(f"Ticker: {company.ticker}\n")
Output:
Copy
Entity ID: 267718Company Name: Pfizer Inc.Country: United StatesDescription: Pfizer Inc. is an American multinational pharmaceutical corporation headquartered in New York City, and with its research headquarters in Groton, Connecticut, United States. The company was founded in 1849.Website: http://www.pfizer.comTicker: PFE...
The find_companies method is helpful to retrieve companies given user’s input, but not to find IDs for a large list of companies, because each call requires a backend request, and it takes longer.
If you still want to use find_companies programmaticaly for a large list of companies, the how-to guide Threading - Find Entities describes a multi-threaded solution.