Guide
Quickstart
Index a website, ask it a question, and call the same search from your own code. Nothing to install, and the free plan needs no card.
-
Create a workspace
Go to app.hayfork.dev/signup. Enter a workspace name, usually your company or team, your work email, and a password of at least ten characters. You land in the console signed in.
A verification link is sent to your email. Verify before you add content: crawls and uploads are refused until the address is confirmed. You can resend the link from the banner in the console.
-
Connect a website
Open Web crawler in the sidebar and paste a public URL, for example your documentation or help centre. The defaults are sensible for a first run:
- Crawl scope is the section your address is in. Paste
https://example.com/docs/and only pages under/docs/are indexed. Enter/for the whole site. - Page limit is 25. Pages come from the sitemap first, within the scope. Raise it for a full site once you have seen the results.
- Link depth beyond the sitemap is 2. It only affects pages the sitemap does not list.
Start the crawl. Each website becomes a reusable data source named after its host, and pages stream into the index as they arrive, so you can search before the crawl finishes. Website sources explains the crawler in detail.
- Crawl scope is the section your address is in. Paste
-
Create a collection
Open Collections and create one. Give it a name such as Product documentation and tick the data source you just crawled. Collections are search scopes: later you can add uploaded files or a second website to the same collection, or make a narrower collection for a support bot.
-
Ask a question
Open Search playground, or press ⌘K, pick the collection and ask something a customer would ask. Each result shows the passage that matched, where it sits in the page, and a link to the source. If the answer is there but ranks low, that is worth knowing before you build on it.
-
Mint a search key
Open Settings and create an API key. Give it a name, keep the
searchscope, and optionally set an expiry. The key is shown once. Copy it now: the server stores only a hash and cannot show it again. A search key can read and search but never change anything, so it is safe to use from a customer-facing app. API keys and scopes has the full rules. -
Call the API
Find your collection's id and run the same search from a terminal:
# list collections to get the id curl https://api.hayfork.dev/collections -H "Authorization: Bearer $HAYFORK_KEY" # search it curl https://api.hayfork.dev/search \ -H "Authorization: Bearer $HAYFORK_KEY" \ -H "Content-Type: application/json" \ -d '{"collection_id": "COLLECTION_ID", "query": "how do refunds work?", "top_k": 5}'The response has
results, each with atitle,snippet,heading_path,scoreandsourceURL, plustook_ms.