The method find_products
returns a list of products that matched the value parameter.
The value can match with the product’s name, or description.
Once you have the IDs, you can use them to filter your search queries with an Entity query filter.
from dotenv import load_dotenv
from bigdata_client import Bigdata
import os
load_dotenv()
# Initialize the Bigdata API
username = os.environ.get("BIGDATA_USERNAME")
password = os.environ.get("BIGDATA_PASSWORD")
bigdata = Bigdata(username, password)
results = bigdata.knowledge_graph.find_products("iPhone")
for product in results:
print(f"Entity ID: {product.id}")
print(f"Product Name: {product.name}")
print(f"Description: {product.description}\n")
Output:
Entity ID: 7373D4
Product Name: iPhone
Description: iPhone is a line of smartphones designed and marketed by Apple Inc. It runs Apple's iOS mobile operating system.The first generation iPhone, aka Iphone 2G was revealed on January 9, 2007.
Entity ID: 990836
Product Name: iPhone 16
Description: iPhone 16 is a mobile phone developed by Apple Inc. Rumors surrounding the product started around January 1, 2024, but was officially launched on September 09, 2024.
...