Back to Home
$httpGet
$httpGet sends a GET request to an API. Use this when you only need to read data. GET requests are the most common type of HTTP request.
Syntax
$httpGet[Url]
Url: the web address of the API you want to get data from.
What happens
$httpGetsends a request to the URL you give it.- The API processes the request and sends data back.
- The response is stored in memory. Use $httpResult to see it.
Example 1: Basic GET request
Fetch a random quote from a quotes API:
$httpGet[https://api.example.com/quotes/random]
$httpResult
What happens:
$httpGetrequests a random quote from the API.- The API returns the quote data.
$httpResultdisplays whatever came back.
To extract specific parts of the response (like the quote text or author name), see the $httpResult page.
Example 2: GET with a specific resource
Some APIs let you request a specific item by including its ID in the URL:
$httpGet[https://api.example.com/users/1]
$httpResult
What happens:
$httpGetrequests the user with ID 1.- The API returns that user's data.
$httpResultshows the full response.
Common uses
- Fetching quotes, jokes, or facts from public APIs
- Getting user data from a database API
- Checking weather or server status
- Reading lists of items, like shop inventory or leaderboard scores
See also
- $httpResult: to read the data that came back
- $httpStatus: to check if the request succeeded
- $httpAddHeader: to send an API key or other header