API Basics - Using APIs in no-code tools

5 Common APIs With Examples

January 14, 2023

In this final post in the series, we will take a look at 5 examples of common APIs, the requests you would make to integrate them into your no-code application, and a sample of the response you would expect. We also explain why you would use each API endpoint.

Google Maps API: 

The Google Maps API allows you to integrate maps and location data into your application. You can use it to display maps, search for places, and get directions. To make a request to the Google Maps API, you would make a GET request to the following endpoint:


https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=37.788022,-122.399797&radius=1500&type=restaurant&key=YOUR_API_KEY

This request would return a JSON object containing information about nearby restaurants within a 1500 meter radius of the provided location.

Example


{
  "html_attributions": [],
  "results": [
    {
      "geometry": {
        "location": {
          "lat": 37.788022,
          "lng": -122.399797
        }
      },
      "icon": "http://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
      "id": "4b5f8f8ff964a520e9b928e3",
      "name": "The Cheesecake Factory",
      "photos": [
        {
          "height": 608,
          "Width": 900,
          "html_attributions": [],
          "photo_reference": "CnRnAAAA48AX5MsHIMiuipON_Lgh97hPiYDFkxx_vnaZQMOcvcQwYN92o33t5RwjRpOue5R47AjfMltntoz71hto40zqYvjv5hqKphC5apE_mWlh3xJlGfLjVelhNc-Us3ZL3HbAOXB-zU5h7C08cxjQ4BIQ-z4ttAMIc8EjEZV-7LsoRoU6OrqxvKCnkJGb9F16W57iIV4U8c"
        }
      ]
    }
  ]
}

Twitter API:

The Twitter API allows you to access tweets and other data from Twitter. You can use it to search for tweets, post tweets, and access user information. To make a request to the Twitter API, you would need to authenticate using OAuth and then make a GET request to the following endpoint:


https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=twitterapi

This request would return a JSON object containing the last 20 tweets from the Twitter API account.

Example


[
  {
    "created_at": "Thu Oct 29 17:12:58 +0000 2020",
    "id": 1321909079653347333,
    "text": "The Twitter API now supports the ability to post and retrieve tweets with a 4-byte encoded UTF-8 character. Learn more in our developer docs: https://t.co/L4Cj4q4WYG",
    "user": {
      "name": "Twitter API",
      "screen_name": "TwitterAPI"
    }
  },
  {
    "created_at": "Thu Oct 29 16:00:00 +0000 2020",
    "id": 1321877981016780800,
    "text": "The Twitter API now supports the ability to post and retrieve tweets with a 4-byte encoded UTF-8 character. Learn more in our developer docs: https://t.co/L4Cj4q4WYG",
    "user": {
      "name": "Twitter API",
      "screen_name": "TwitterAPI"
    }
  }
]

Weather API:

The Weather API allows you to access weather information such as temperature, humidity, and precipitation. You can use it to display the current weather or forecast information in your application. To make a request to a weather API, you would make a GET request to the following endpoint:

https://api.openweathermap.org/data/2.5/weather?q=London,uk&appid=YOUR_API_KEY

This request would return a JSON object containing information about the current weather in London.

Example


{
  "coord": {
    "lon": -0.13,
    "lat": 51.51
  },
  "weather": [
    {
      "id": 300,
      "main": "Drizzle",
      "description": "light intensity drizzle",
      "icon": "09d"
    }
  ],
  "base": "stations",
  "main": {
    "temp": 280.32,
    "pressure": 1012,
    "humidity": 81,
    "temp_min": 279.15,
    "temp_max": 281.15
  },
  "visibility": 10000,
  "wind": {
    "speed": 4.1,
    "deg": 80
  },
  "clouds": {
    "all": 90
  },
  "dt": 1485789600,
  "sys": {
    "type": 1,
    "id": 5091,
    "message": 0.0103,
    "country": "GB",
    "sunrise": 1485762037,
    "sunset": 1485794875
  },
  "id": 2643743,
  "name": "London",
  "cod": 200
}

Spotify API: 

The Spotify API allows you to access music and playlists from Spotify. You can use it to search for music, create playlists, and access user information. To make a request to the Spotify API, you would need to authenticate using OAuth and then make a GET request to the following endpoint:

https://api.spotify.com/v1/search?q=artist:%22Drake%22&type=artist

This request would return a JSON object containing information about the artist Drake.

Example


{
  "artists": {
    "href": "https://api.spotify.com/v1/search?query=artist%3A%22Drake%22&type=artist&offset=0&limit=20",
    "items": [
      {
        "external_urls": {
          "spotify": "https://open.spotify.com/artist/3TVXtAsR1Inumwj472S9r4"
        },
        "followers": {
          "href": null,
          "total": 70918743
        },
        "genres": [
          "canadian hip hop",
          "hip hop",
          "pop rap",
          "rap"
        ],
        "href": "https://api.spotify.com/v1/artists/3TVXtAsR1Inumwj472S9r4",
        "id": "3TVXtAsR1Inumwj472S9r4",
        "images": [
          {
            "height": 640,
            "url": "https://i.scdn.co/image/ab67616d0000b2738d4f2c5e5b4e4c4f4b2f2b7c",
            "width": 640
          },
          {
            "height": 320,
            "url": "https://i.scdn.co/image/ab67616d00001e028d4f2c5e5b4e4c4f4b2f2b7c",
            "width": 320
          },
          {
            "height": 160,
            "url": "https://i.scdn.co/image/ab67616d000048518d4f2c5e5b4e4c4f4b2f2b7c",
            "width": 160
          }
        ],
        "name": "Drake",
        "popularity": 98,
        "type": "artist",
        "uri": "spotify:artist:3TVXtAsR1Inumwj472S9r4"
      }
    ],
    "limit": 20,
    "next": null,
    "offset": 0,
    "previous": null,
    "total": 1
  }
}

This response includes information about the artist Drake like external_urls, followers, genres, href, id, images, name, popularity, and type, and uri.

News API:

The News API allows you to access news articles from a variety of sources. You can use it to display news headlines, search for articles, and access article details. To make a request to the News API, you would make a GET request to the following endpoint:

https://newsapi.org/v2/everything?q=apple&from=2023-01-14&to=2023-01-14&sortBy=popularity&apiKey=API_KEY

Example

This request would return a JSON object containing the top headlines about Apple.


{
  "status": "ok",
  "totalResults": 808,
  "articles": [
    {
      "source": {
        "id": "wired",
        "name": "Wired"
      },
      "author": "Boone Ashworth",
      "title": "Apple Is Reportedly Testing MacBooks With Touchscreens",
      "description": "Plus: Samsung sets a date for the next Galaxy Unpacked, Xbox gets a power-saving mode, and the right-to-repair fight rages on.",
      "url": "https://www.wired.com/story/apple-tests-touchscreen-macbooks/",
      "urlToImage": "https://media.wired.com/photos/63c1b4a4c70009d9f70492c7/191:100/w_1280,c_limit/Biz-Apple-store-1445281649.jpg",
      "publishedAt": "2023-01-14T14:00:00Z",
      "content": "After years of saying it wouldnt ever slap a touchscreen on a laptop, Apple may now be planning to do just that. A report by Mark Gurman at Bloomberg asserts that Apple is testing touchscreen tech on… [+3247 chars]"
    },
    {
      "source": {
        "id": null,
        "name": "The Guardian"
      },
      "author": "Patrick Butler Social policy editor",
      "title": "Ex-homelessness charity bosses get 15-year ban for misuse of funds",
      "description": "Charity Commission inquiry showed Ashley and Lee Dribben spent large sums meant for vulnerable people on themselvesFormer homelessness charity bosses who authorised spending thousands in funds on watches, 50-in TVs and spyware to eavesdrop on clients have bee…",
      "url": "https://www.theguardian.com/society/2023/jan/14/ex-homelessness-charity-bosses-get-15-year-ban-for-misuse-of-funds",
      "urlToImage": "https://i.guim.co.uk/img/media/944360e47df334b9e1f9fe4aee1a76648afddc4c/215_684_4259_2556/master/4259.jpg?width=1200&height=630&quality=85&auto=format&fit=crop&overlay-align=bottom%2Cleft&overlay-width=100p&overlay-base64=L2ltZy9zdGF0aWMvb3ZlcmxheXMvdGctZGVmYXVsdC5wbmc&enable=upscale&s=cc010e5ad6c62d540e37ec39fc2edce0",
      "publishedAt": "2023-01-14T06:00:36Z",
      "content": "Former homelessness charity bosses who authorised spending thousands in funds on watches, 50-in TVs and spyware to eavesdrop on clients have been found guilty of misconduct by the Charity Commission.… [+4780 chars]"
    }
  ]
}

As you can see, the response from the News API is a JSON object containing a list of articles about Apple, each containing information such as the source, author, title, description, url, urlToImage, publishedAt

These are just a few examples of the many common APIs that are available. Each API is unique and has its own set of endpoints and functionality. It's a good idea to refer to the API's documentation for more information on the specific requests that you can make and the data that you can expect to receive in return. With the knowledge you've gained in this series, you should be able to work with APIs and integrate them into your no-code tools to create powerful and efficient software solutions.