> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: getJSON(url: string, options: WixFetchRequest) # Method package: wixFetch # Method menu location: wixFetch --> getJSON # Method Link: https://dev.wix.com/docs/velo/apis/wix-fetch/get-json.md # Method Description: Retrieves the specified JSON resource from the network using HTTPS. The `getJSON()` function retrieves a JSON resource from the network. It returns a Promise that resolves to a JSON object representing the response to the request. To use `getJSON`, import it from `wix-fetch`: ```javascript import {getJSON} from 'wix-fetch'; ``` Retrieving the JSON object is performed using the GET method, regardless of what is specified in the `options` parameter. The `Accept` header is assumed to be `application/json` by default, but you can override it by explicitly setting a different value for `Accept`. The optional `WixFetchRequest` object contains information about an HTTPS request. Additional functionality is available in each of the respective [Fetch API implementations](wix-fetch/introduction). > **Notes:** > Some common errors when using the `getJSON()` function are described here along with possible solutions. > > - You can usually tell if you are experiencing these issues by checking your browser's console using the [browser's developer tools](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_are_browser_developer_tools). > - Certain [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) (Cross-Origin Resource Sharing) requests are restricted when originating from a browser. Usually, GET requests and certain POST requests can be made from your site's **Public**, **Page**, or **Site** code. All other requests need to be made from your site's **Backend** code. If you are experiencing an issue with a `getJSON()` call due to a CORS restriction, move the `getJSON()` call to the backend as described in [Accessing 3rd-Party Services](https://support.wix.com/en/article/accessing-3rd-party-services#backend-service-call). > - You cannot request HTTP content, only HTTPS. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Get a JSON resource ```javascript import {getJSON} from 'wix-fetch'; // ... getJSON("https://someapi.com/api/someendpoint") .then(json => console.log(json.someKey)) .catch(err => console.log(err)); ``` ## Get a JSON resource ```javascript import { getJSON } from 'wix-fetch'; // GET call using getJSON export async function getGreetings() { const response = await getJSON('https://velo-examples.wixsite.com/training-tester/_functions/greetings'); return response; } ``` ---