This is a demo of startupradar.co's API combined with OpenAI embeddings to find similar startups.
The code works as follows:
- load the list of startup domains in
domains.txt
- fetch descriptions of these startups with startupradar's API
- create embeddings for all startups with OpenAI
- compute cosine similarities between all pairs
- output a similarity matrix as
similarity_matrix.csv
The formatted output looks like this:
and the provided sample can be found in a public Google Sheet.
Install the dependencies into a virtual environment.
pip install -r requirements.txt
Create a config.py
file and add the credentials for startupradar and OpenAI:
STARTUPRADAR_API_KEY = "your-key-here"
OPENAI_API_KEY = "your-key-here"
OPENAI_ENGINE = "text-similarity-davinci-001"
An API key for OpenAI can be created online. Please note that embedding a lot of startups can result in significant charges. Make sure to set budgets upfront!
Run with
python cli.py run