Skip to content

Commit f029b71

Browse files
author
Thomas Hurst
committed
README: Improve examples
1 parent 1c9ac69 commit f029b71

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

README.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,38 @@ $ export SERPAPI_KEY="..."
6060
6161
# Extract specific elements using JSONPath
6262
$ serpapi-cli -j '$["account_email", "plan_searches_left"]' account
63-
"thomas@serpapi.com"
64-
30
63+
[
64+
"thomas@serpapi.com",
65+
0
66+
]
6567
6668
# Or with multiple JSONPointer expressions
6769
$ serpapi-cli -p '/account_email' -p '/plan_searches_left' account
68-
"thomas@serpapi.com"
69-
30
70+
[
71+
"thomas@serpapi.com",
72+
0
73+
]
7074
7175
# Look up a location
7276
$ serpapi-cli -p /0/canonical_name location Austin
7377
"Austin,TX,Texas,United States"
7478
7579
# Extract the first result from a search with a given location
76-
$ serpapi-cli -j '$.organic_results[0]["link", "snippet"]' search serpapi "location=Austin,TX,Texas,United States"
77-
"https://serpapi.com/"
78-
"SerpApi is a real-time API to access Google search results. We handle proxies, solve captchas, and parse all rich structured data for you."
80+
$ serpapi-cli -j '$.organic_results[0]["link", "snippet"]' search serpapi "location=Austin,TX,Texas,United States"
81+
[
82+
"https://serpapi.com/",
83+
"SerpApi is a real-time API to access Google search results. We handle proxies, solve captchas, and parse all rich structured data for you."
84+
]
85+
86+
# Find our social media accounts using Bing (with bonus random Wikipedia page)
87+
$ serpapi-cli -j '$.knowledge_graph.profiles[*].link' search serpapi engine=bing
88+
[
89+
"https://www.facebook.com/serpapicom/",
90+
"https://twitter.com/serp_api",
91+
"https://instagram.com/serpapicom",
92+
"https://youtube.com/channel/ucugihlybod3ya3ydirhg_mg",
93+
"https://en.wikipedia.org/wiki/iso_3166-1"
94+
]
7995
```
8096

8197
[SerpApi]: https://serpapi.com/

0 commit comments

Comments
 (0)