With hundreds of integrations, n8n saves you countless hours by making it possible to combine and automate different apps and services. But what happens when there’s no node for a tool you need?

Enter the HTTP Request node––one of the most versatile and powerful nodes in the n8n ecosystem. This node can send any type of HTTP request, allowing you to talk to the RESTful APIs of the apps you need.

In this article, I’ll show you how to configure the HTTP Request node for three simple use cases:

  1. Scraping a webpage
  2. Creating a DigitalOcean droplet
  3. Converting speech-to-text

Table of contents

Prerequisites
Workflow 1: Scraping data from HackerNoon
Workflow 2: Creating a cloud instance on DigitalOcean
Workflow 3 : Converting speech to text with Wit.ai
What's next?

Prerequisites

To follow along these short tutorials, you need to have:

  • n8n setup: You can either install n8n locally, or use the cloud instance.
  • DigitalOcean credentials (only for workflow 2): You need to sign up for an account on DigitalOcean and generate your Personal Access Token from the API section.
  • Wit.ai credentials (only for workflow 3): You need to sign up for an account on Wit.ai, create a new App, then go to Settings and get your Server Access Token.

Workflow 1 : Scraping data from HackerNoon

Wouldn’t it be great to automatically get a list of the most recent HackerNoon articles? That’s what this first workflow is about. We’ll use the HTTP Request node with the GET method to retrieve the homepage of Hackernoon and extract the names and URLs of all the articles.

To get started, copy this workflow and paste it into your Editor UI. The workflow consists of three nodes:

  1. HTTP Request node to get the source code of the webpage
  2. HTML Extract 1 node to extract the article headings
  3. HTML Extract node 2 to extract specific information from webpage

Now let’s see how to configure each node.

1. HTTP Request Node

In the HTTP Request node, configure the following parameters:

  • Request Method: GET
  • URL: https://hackernoon.com
  • Response Format: String

When you execute the node, you’ll see the retrieved source code of the page.

2. HTML Extract 1 node

In the HTML Extract node, configure the following parameters:

  • Source Data: JSON
  • JSON Property: data

Add a value with the following properties:

  • Key: item
    This is the name under which the extracted titles will be saved. You can choose any name you want.
  • CSS Selector: h2
    This is the class name of the element you want to extract data from. In our case, all the blog titles are h2 elements.
  • Return Value: HTML
  • Return Array: Toggle to True

3. HTML Extract 2 node

In the HTML Extract 2 node, configure the following parameters:

  • Source Data: JSON
  • JSON Property: item

Add two values with the following properties:

  • Value 1:
  •  Key: Title
  •  CSS Selector: a
  •  Return Value: Text

  • Value 2:
  •  Key: url
  •  CSS Selector: a
  •  Return Value: Attribute
  •  Attribute: href

Now when you execute the node, you’ll see the titles and URLs of each article from HackerNoon.

Here’s a video illustrating the steps described above:

Extracting data from a webpage using n8n

Follow-up idea: Use the Google Sheets node or Airtable node to save the scraped titles in a spreadsheet. For more inspiration, check out uProc’s complex web-scraping workflow.

Workflow 2 :  Creating a cloud instance on DigitalOcean

DigitalOcean is a leading web hosting provider. In this use case, we’ll use the HTTP Request node with the POST method to create a cloud virtual machine on DigitalOcean.

This workflow consists of only one node – the HTTP node, with the following parameters:

Next, add an option Body Content Type: JSON.

Now add Body Parameters, which tell DigitalOcean what kind of a droplet to create. I chose to add four basic parameters, but you can add several different parameters (refer to the DigitalOcean docs).

  • Name: name
    Value: API-creation-test
  • Name: region
    Value: blr1
  • Name: size
    Value: s-1vcpu-1gb
  • Name: image
    Value: ubuntu-20-04-x64

Next, we need to add the authorization header with the following values:

  • Name: Authorization
  • Value: Bearer {your_personal_access_token}

Execute the node, then head over to your DigitalOcean console. You should see that a new droplet with the name API-creation-test has been created.

Here’s a video illustrating the steps described above:

Creating a cloud instance on DigitalOcean using n8n

Workflow 3 : Converting speech to text with Wit.ai

Wit.ai is a natural language processing (NLP) interface for applications capable of turning sentences into structured data and building chatbots. Doesn’t that sound fun? In this workflow, we’ll use Wit.ai’s API in the HTTP Request node to convert speech from an audio file to text. The workflow consists of two nodes:

  1. Read Binary File node to read the audio recording
  2. HTTP Request node to access the Wit.ai API

1. Read Binary File node

In the Read Binary File node configure the following parameters:

  • File Path: /data/demo1.wav
    This is the audio file we want to convert into text.
  • Property Name: data
    You can choose any name you want.

2. HTTP Request node

In the HTTP Request node configure the following parameters:

  • Request Method: POST
  • URL: https://api.wit.ai/speech?v=20200513
  • Response Format: JSON
  • JSON/RAW Parameters: Toggle to True

Next, add an option Body Content Type: RAW/Custom. Below, add the following information:

  • Send Binary Data: Toggle to True
  • Binary Property: data
  • Headers: {{JSON.parse('{"Authorization":"Bearer {your_token_goes_here}", "Content-Type":"audio/wav"}')}}

Execute the node and in a couple of seconds you should see the detected text returned from Wit.ai.

Here’s a video illustrating the steps described above:

Speech to text conversion using Wit.ai and n8n

Follow-up idea: Translate the text message into another language with the Google Translate node or LingvaNex node (like in this poetry workflow). Moreover, you can analyze the sentiment of the message with the Google Cloud Natural Language node or AWS Comprehend node.

What’s next?

In this tutorial, you learned to use the HTTP Request node to extract information from the web, create a cloud server, and convert speech to text. Since most of the internet functions on HTTP requests, you can use n8n to integrate any platform that supports a RESTful API and automate cross-platform tasks.

Much like people, the technology works better as a collective. Now that you know how to use the HTTP Request node, the possibilities for automation are endless.

In case you run into issues following the tutorial, feel free to reach out to me on LinkedIn or ask for help on our forum 💙

Start automating!