@@ -28,6 +28,15 @@ To install ``serpapi-python``, simply use `pip`::
2828
2929Please note that Python 3.6+ is required.
3030
31+
32+ Usage
33+ -----
34+
35+ To use this module,
36+
37+ TODO write this.
38+
39+
3140API Reference
3241=============
3342
@@ -38,18 +47,55 @@ This part of the documentation covers all the interfaces of :class:`serpapi` Pyt
3847.. module :: serpapi
3948 :platform: Unix, Windows
4049 :synopsis: SerpApi Python Library
50+ :members:
51+ :undoc-members:
4152
42- Primary interface
43- -----------------
53+ .. autofunction :: serpapi.search
54+ .. autofunction :: serpapi.search_archive
55+ .. autofunction :: serpapi.locations
56+ .. autofunction :: serpapi.account
57+
58+ API Client
59+ ----------
4460
4561The primary interface to `serpapi-python ` is through the :class: `serpapi.Client ` class.
62+ The primary benefit of using this class is to benefit from Requests' HTTP Connection Pooling.
63+ This class also alleviates the need to pass an ``api_key` `` along with every search made to the platform.
4664
4765.. autoclass :: serpapi.Client
48- :members:
4966
50- .. autoclass :: serpapi.client.SerpResults
51- :members:
67+ .. automethod :: Client.search
68+ .. automethod :: Client.search_archive
69+ .. automethod :: Client.account
70+ .. automethod :: Client.locations
71+
5272
73+ Results from SerpApi.com
74+ ------------------------
75+
76+ When a successful ``serpapi.search `` has been executed, the call returns
77+ an :class: `SerpResults <serpapi.SerpResults> ` object, which acts just like a standard dictionary,
78+ with some convenient functions added on top.
79+
80+
81+ .. code-block :: python
82+
83+ >> > s = serpapi.search(" Coffee" , engine = " google" , location = " Austin, Texas" , hl = " en" , gl = " us" )
84+ >> > type (s)
85+ < class ' serpapi.models.SerpResults' >
86+
87+ >> > s[" organic_results" ][0 ][" link" ]
88+ ' https://en.wikipedia.org/wiki/Coffee'
89+
90+ >> > s[" search_metadata" ]
91+ {' id' : ' 64c148d35119a60ab1e00cc9' , ' status' : ' Success' , ' json_endpoint' : ' https://serpapi.com/searches/a15e1b92727f292c/64c148d35119a60ab1e00cc9.json' , ' created_at' : ' 2023-07-26 16:24:51 UTC' , ' processed_at' : ' 2023-07-26 16:24:51 UTC' , ' google_url' : ' https://www.google.com/search?q=Coffee&oq=Coffee&uule=w+CAIQICIdQXVzdGluLFRYLFRleGFzLFVuaXRlZCBTdGF0ZXM&hl=en&gl=us&sourceid=chrome&ie=UTF-8' , ' raw_html_file' : ' https://serpapi.com/searches/a15e1b92727f292c/64c148d35119a60ab1e00cc9.html' , ' total_time_taken' : 1.55 }
92+
93+
94+ .. autoclass :: serpapi.SerpResults
95+
96+ .. automethod :: SerpResults.next_page
97+ .. automethod :: SerpResults.yield_pages
98+ .. autoproperty :: SerpResults.next_page_url
5399
54100
55101Exceptions
@@ -58,9 +104,6 @@ Exceptions
58104.. autoexception :: serpapi.SerpAPIError
59105 :members:
60106
61- .. autoexception :: serpapi.APIKeyNotProvided
62- :members:
63-
64107.. autoexception :: serpapi.SearchIDNotProvided
65108 :members:
66109
0 commit comments