Zapier: start a search from a Google Sheet
Add a competitor's website to a sheet and RecruitAffiliates.ai starts a search for their affiliates.
Keep a Google Sheet of competitors. Each time you add a row, Zapier starts a competitor search in RecruitAffiliates.ai. A competitor search finds the people who already promote a rival product.
Each search uses one search credit. If it can't start, the credit comes back.
What you need
- A plan that includes the API, and a key with the
finder:writescope. - A Google Sheet with a column called
Domain, likeexample.com. - A Zapier account. The request step uses "Webhooks by Zapier", which needs a paid Zapier plan.
Build the Zap
- In Zapier, create a Zap. For the trigger, pick "Google Sheets" and the event "New Spreadsheet Row". Point it at your sheet.
- Add an action. Pick "Webhooks by Zapier" and the event "Custom Request".
- Fill in the request like this:
| Setting | Value |
|---|---|
| Method | POST |
| URL | https://api.affiliaterail.com/v1/finder/searches |
| Data pass-through | False |
| Data | {"type": "competitor", "seed": "{{Domain}}"} |
| Unflatten | Yes |
- Add three headers:
| Header | Value |
|---|---|
Authorization | Bearer rail_test_... |
Content-Type | application/json |
Idempotency-Key | sheet-row-{{Row ID}} |
In the Data box, replace {{Domain}} with the Domain field from the trigger. In the header, replace {{Row ID}} with the row's id from the trigger.
- Test the step. With a test key you get back a search in the
queuedstate, and nothing is spent. - Swap the test key for a live key and turn the Zap on.
Why the row id is in the key
An idempotency key is a unique string you send so a retried request never runs twice. Zapier retries a step when it times out. Using the row's id means a retry of the same row reuses the same key. You get the first search back instead of paying for a second one.
Check on the search
A search takes a while to run. To see how it's going, add a later step with "Custom Request":
- Method:
GET - URL:
https://api.affiliaterail.com/v1/finder/searches/{{id}}, using theidfrom step 3's answer - Header:
Authorization: Bearer rail_...
The new matches show up in the app, and in GET /prospects, when it's done.
If something goes wrong
- A
402means your plan doesn't include the API. - A
429means you've hit the rate limit. Zapier waits and retries on its own. - Anything else: read
error.messagein the Zap's run history. It says what to fix.
Every rule for keys, errors and limits is in the API guide.
Get events the moment they happen
The Zap above asks RecruitAffiliates.ai to do something. A webhook works the other way round: we tell Zapier the moment something happens, like a reply or a finished search. Webhooks explains the events. You need a plan that includes webhooks.
- Start a Zap. For the trigger, pick "Webhooks by Zapier", then "Catch Raw Hook".
- Copy the webhook URL Zapier shows you.
- In RecruitAffiliates.ai, go to Settings, then the Webhooks tab. Add the URL as an endpoint and pick your events.
- Press Send a test, then press "Test trigger" in Zapier to pull it in.
"Catch Raw Hook" keeps the raw body and headers, so a Code step can check the signature. "Catch Hook" reads the JSON for you, but then you can't check the signature.
Keep the URL private. Anyone who has it can post to your Zap. Checking the signature is what stops a fake.
Was this page helpful?