Exa Search Engine
Exa Search Engine
CUSTOM
# SET UP
Create an Exa account for an API key.
Install Python 3 and pip (if not already done).
In your code editor, create a main.py file.
Install the Exa package using:
bash
Swipe
# INITIALIZING THE API
python
MAKING A SEARCH
# REQUEST
Example of using Exa's .search() method:
python
response = exa.search(
'Best Chicago cold brew',
num_results=10,
)
Swipe
# CUSTOMIZING SEARCHES
You can fine-tune searches using filters, such as:
numResults: Limit number of results.
includeDomains: Limit search to specified domains.
category: Search specific content types (e.g., tweets,
papers).
response = exa.search(
'best pizza in Brooklyn',
num_results=10,
start_published_date='2023-05-01',
category='tweet',
use_autoprompt=True,
)
# SEARCH COFFEE ON
TIKTOK
Swipe
This is where the fun customization begins! ✨💖
For this tutorial, you'll learn how to search TikTok to obtain
top coffee drink accounts!
python
python3 main.py
Swipe
Let's format our code so that for our React documentation
search engine, we only get the Title and the URL. Delete the
print statement, and add the following to main.py.
python
Swipe
MISSION
ACCOMPLISHED!
#
Congrats, you just created a custom search engine! ✨
Here are some additional ideas on what you could search with the
Exa API!
Wikipedia links
Coding documentation
Academic papers
Tweets
Research papers
News and media