@@ -17,7 +17,7 @@ migrate over to the `serpapi` npm package.
1717
1818 // ✅ New way, import and use functions directly.
1919 import { getJson } from " serpapi" ;
20- getJson (" google" , { api_key: API_KEY , ... })
20+ getJson ({ engine : " google" , api_key: API_KEY , ... })
2121 ```
2222
2323- The ` search_archive ` method is replaced by ` getJsonBySearchId ` and
@@ -63,15 +63,15 @@ migrate over to the `serpapi` npm package.
6363 engine .json ({ q: " coffee" , api_key: undefined });
6464
6565 // ✅ Now, no error is thrown when api_key is null
66- getJson (" google" , { q: " coffee" , api_key: null });
66+ getJson ({ engine : " google" , q: " coffee" , api_key: null });
6767 ```
6868
6969## Added
7070
7171- TypeScript types for supported parameters.
7272- First-class Promises support.
7373 ``` js
74- const json = await getJson (" google" , { q: " coffee" });
74+ const json = await getJson ({ engine : " google" , q: " coffee" });
7575 ```
7676- ` config ` object to configure global ` api_key ` and ` timeout ` values.
7777 ``` js
@@ -81,6 +81,6 @@ migrate over to the `serpapi` npm package.
8181 ```
8282- Error classes (` MissingApiKeyError ` and ` InvalidTimeoutError ` ).
8383 ``` js
84- getJson (" google" , { api_key: " " }); // Throws `MissingApiKeyError`
84+ getJson ({ engine : " google" , api_key: " " }); // Throws `MissingApiKeyError`
8585 getAccount ({ api_key: API_KEY , timeout: 0 }); // Throws `InvalidTimeoutError`
8686 ```
0 commit comments