HARPA.AI
LIBRARYUSE CASESGUIDESAI COMMANDSBLOG

Regional Search via SerpApi

CONTENTS
NAVIGATE

# What is SerpApi?

SerpApi offers real-time Google search access, simplifying proxy management, captcha solving, and JSON parsing. It's useful for SEO, market research, and competitive analysis across search engines like Google and Bing. With its pay-as-you-go model and strong API support, SerpApi suits scalable search data projects. Its GitHub presence and positive Trustpilot reviews confirm its reliability and efficiency.

# How SerpApi Works with HARPA AI

HARPA AI and SerpApi can complement each other effectively, with HARPA acting as a connector linking LLM and search results obtained from SerpApi. SerpApi stands out by offering 100 free search requests each month, a deal not matched by others.

SerpApi also fully supports Web Search Operators, allowing you to find search results that exactly match what you're looking for.

# How to Connect HARPA to SerpApi

  1. Sign up at https://serpapi.com/users/sign_up

  1. Confirm your email and phone number
  2. Open HARPA AI by clicking its icon in the top right corner or pressing Alt+A (on Windows) and ^+A (on Mac).
  3. Type / in chat.
  4. Click the CREATE option at the top.
  5. Add the ASK step that will request the user’s query to save it in a parameter (e.g., '{{query}}').

  1. Add the REQUEST step that will GET a response via the API based on your saved {{query}} parameter. Don't forget to enter your API key from your SerpApi account.
https://serpapi.com/search.json?engine=google&q={{query}}&api_key=<<ENTER_YOUR_API_KEY>>

You can add search operators to this URL, the full list is available on this page..

To search in the US region for results in English, use this REQUEST step:

https://serpapi.com/search.json?engine=google&q={{query}}&api_key=<<ENTER_YOUR_API_KEY>>&hl=en&gl=us

  1. You can also use the SerpApi Playground to visually see the differences in search results and understand which search results are stored in the data array you receive.

  1. The search result is a JSON file:

You can download through the EXPORT step:

  1. Alternatively, you can use RUN JS code to extract the information you need from the data received. For example, to get Organic Search results, you need to refer to the corresponding part of the JSON:

arguments:
data

js code to run:
return data?.body?.organic_results || []
  1. Use the SAY step to turn the {{array}} into a markdown formatted text:

✅ SERP data extracted:
- **{{array.0.source}}**: [{{array.0.title}}]({{array.0.link}}): {{array.0.snippet}}.
- **{{array.1.source}}**: [{{array.1.title}}]({{array.1.link}}): {{array.1.snippet}}.
- **{{array.2.source}}**: [{{array.2.title}}]({{array.2.link}}): {{array.2.snippet}}.
- **{{array.3.source}}**: [{{array.3.title}}]({{array.3.link}}): {{array.3.snippet}}.
- **{{array.4.source}}**: [{{array.4.title}}]({{array.4.link}}): {{array.4.snippet}}.
- **{{array.5.source}}**: [{{array.5.title}}]({{array.5.link}}): {{array.5.snippet}}.
- **{{array.6.source}}**: [{{array.6.title}}]({{array.6.link}}): {{array.6.snippet}}.
- **{{array.7.source}}**: [{{array.7.title}}]({{array.7.link}}): {{array.7.snippet}}.
  1. You can use this data {{array}} for navigating through links in LOOPs using NAVIGATE steps.
  • Add the LOOP step where actions will be performed on an {{array}}.

  • Go into the LOOP step and add a NAVIGATE step with the {{item.link}} parameter, which will refer to the URL value for each item used.

  • By navigating through each link in the SERP, you can perform some action, for example, extract LSI keywords via this GPT step:

I want you to respond only in {{language}} and output a single list.

Pretend to be a SEO keyword research expert.

Read the [PAGE CONTENT] that I will provide you and find top 20 LSI keywords, each containing at least 2 words:
- Please identify and list LSI Keywords that are specifically associated with [MY QUERY].
- When extracting these keywords, focus on finding terms that are not just relevant in a broad sense but are specifically combined or contextually linked with [MY QUERY] that I will provide you later.
- Response with only these LSI keywords, separated by commas. 
- Do not add any notes, write only comma separated keywords.
- Do not echo my prompt.

[MY QUERY]: {{query}}

[PAGE CONTENT]:
{{page}}

[ONLY KEYWORDS]:

Now your Custom Command goes through the links in the SERP, creating a LSI keywords list for each of them.

  • Save all the information from GPT steps into one parameter, such as a new array with a different name using CALC: ADD LIST ITEM.

What can I do next?

  • You could create a prompt that integrates all LSI keywords into a comprehensive report.
I want you to respond only in {{language}} and output a single list.

Pretend to be a SEO keyword research expert.
I want you to generate a report on LSI keywords.

Read the [KEYWORDS LIST] that I will provide you and find top 40 LSI keywords, each containing at least 2 words:
- Please identify and list LSI Keywords that are specifically associated with [MY QUERY].
- When extracting these keywords, focus on finding terms that are not just relevant in a broad sense but are specifically combined or contextually linked with [MY QUERY] that I will provide you later.
- Response with only these LSI keywords, separated by commas. 
- Do not add any notes, write only comma separated keywords.
- Do not echo my prompt.

[MY QUERY]: {{query}}

[KEYWORDS LIST]:
{{keywords}}

[KEYWORDS REPORT]:
  • You could start any command with the COMMAND step and use the list of LSI keywords and SERP data to create a blog post.

NEXT POST
Contact us
HomeUse CasesGuidesPrivacy PolicyTerms of Service