With over 150 nodes, n8n saves countless hours by automating repetitive tasks. But what happens when n8n doesn’t have a node for a tool you love? Enter the node. This node can send any type of , making it useful to talk to any RESTful API. This makes the node one of the most versatile and powerful nodes in the n8n ecosystem. HTTP Request HTTP request HTTP Request In this article, we are going to explore three examples to showcase how the node can be used in your workflow to automate tasks: HTTP Request Getting a web page and extracting data from it via a GET request Creating a cloud via a POST request VM Performing speech-to-text by sending an audio file via a POST request Getting Ready Setting up n8n This tutorial assumes that you already have n8n set up and running. In case you don’t, you can install with : npm npm n8n -g install After the installation, start n8n by typing: n8n start --tunnel Note: This is only meant for local development and testing. For information on how to deploy n8n in a production environment, please refer to the n8n setup guide . Workflow 1 — Getting a Webpage and Extracting Data For this example, I’ll be retrieving the homepage of and extracting the names and URLs of all the articles. Hackernoon You can also follow along this example by copying the from n8n.io and making appropriate changes at each step. workflow Add a new node by clicking the + button at the top right of the Editor UI and selecting the node from the list. Then, select the GET option for HTTP Request HTTP Request Request Method. Enter as the Set the to ‘String’ and then click on You’ll see that the source code of the page has been retrieved by n8n. https://hackernoon.com URL. Response Format Execute Node. Next, add a node and connect it to the node. Select ‘JSON’ for Set a of your choice — this is the name under which the extracted titles will be saved. Next, enter the CSS class name of the element you want to extract data from. In our case, all the blog titles are elements, so I put as the Select ‘HTML’ as the and set to ‘True’ (make the slider green). HTML Extract HTTP Request Source Data. Key h2 h2 CSS Selector. Return Value Return Array Add another node and connect it to the previous node. Select ‘JSON’ for Click under the ‘Extraction Values’ section and add a value with the as , as and the as ‘Text’. Similarly, add another entry in the section, with the as , as , the as ‘Attribute’, and as . HTML Extract HTML Extract Source Data. Add Value Key title CSS Selector a , Return Value Extraction Values Key url CSS Selector a Return Value Attribute href Now click on and you will see the titles and URLs of each blog post. Execute Node Here’s a GIF of me following the steps above. Workflow 2 — Creating a cloud instance on DigitalOcean For this example, we will be creating a cloud instance on , a leading web hosting provider. DigitalOcean You can also follow along this example by copying the from n8n.io and making appropriate changes at each step. workflow allows the creation of new droplets via a POST Request, which we will be using, in conjunction with the node. DigitalOcean’s API HTTP Request First, sign up for an account on DigitalOcean’s website. Then, once you’re logged in, generate and copy your ‘Personal access token’ from the . This is what we will use to authenticate against the API in n8n. API section Now, head over to n8n and create a new workflow. Next, add a node and select POST as the Type in as the . Set the to ‘JSON’. Add a option and select ‘JSON’. HTTP Request Request Method. https://api.digitalocean.com/v2/droplets URL Response Format Body Content Type It’s time to add to the request. These parameters tell DigitalOcean what kind of a droplet to create. I chose to add four basic parameters, but you can add several different parameters (Refer: ). Body Parameters DigitalOcean docs You can add a parameter by clicking the button and adding in the names and values as shown below. Add Parameter ┌────────┬──────────────────┐ │ Name │ Value │ ├────────┼──────────────────┤ │ name │ n8n-rocks │ │ region │ blr1 │ │ size │ s-1vcpu-1gb │ │ image │ ubuntu-20-04-x64 │ └────────┴──────────────────┘ Next, we will add the authorization header. Scroll down to the section and add a new Header with the name ‘Authorization’ and the value as . Headers Bearer {your_DO_token} Now click ‘Execute Node’ and head over to your DigitalOcean console. You should see that a new droplet with the name has been created. n8n-rocks Here’s a GIF of me following the steps above. Workflow 3 — Speech to text conversion using Wit.ai For this example, we will converting speech to text from audio files using . We will send audio files and receive the detected text via the . Wit.ai HTTP API You can also follow along this example by copying the from n8n.io and this , making appropriate changes at each step. workflow audio sample First, sign up for an account on . Create a New App. Then, head over to Settings and copy your ‘Server Access Token’. We will use this later when setting up the node credentials in n8n. Wit.ai Now, head over to n8n and create a new workflow. Add a node. Then, enter the to your audio sample and choose a Read Binary File File Path Property Name. Then, add a new node and connect both nodes. Select ‘POST’ as the Type in as the . Then, select ‘JSON’ as the Select as ‘True’ (make the slider green). Next, add a option, selecting ‘RAW/Custom’. HTTP Request Request Method. https://api.wit.ai/speech?v=20200513 URL Response Format. JSON/RAW Parameters Body Content Type Select as ‘True’ and enter the property name that you picked earlier. In the section, enter the following, replacing with the ‘Server Access Token’ you copied from Wit.ai. Send Binary Data Headers {your_token_goes_here} {{JSON.parse( { : , : }')}} ' "Authorization" "Bearer {your_token_goes_here}" "Content-Type" "audio/wav" Now click ‘Execute Node’ and in a couple of seconds, you should see the detected text returned from Wit.ai. Here’s a GIF of me following the steps above. Further exploration Since most of the internet functions on HTTP requests; you can use n8n to integrate any platform that supports a RESTful API using a similar set of steps (consult the documentation) for the appropriate settings. You can also use n8n to automate cross-platform tasks, by integrating several platforms into your workflow. For example, the data extracted from the webpage could be saved to a Google Sheet by adding a node to the workflow. The text detected using Wit.ai could be connected to Google’s using the node and translated to a different languages! Translate API HTTP Request Conclusion In this tutorial, we learnt to use the node to extract information from the web, create a cloud server and convert speech to text. We also discussed the possibility of using the node with other RESTful APIs and the versatility in doing so, most of the web functions on HTTP requests. HTTP Request HTTP Request Much like people, technology works better as a collective. n8n enables you to integrate a tool with any other tool, enabling cross-platform workflows like never before. The possibilities are endless. What will you automate? In case you’ve run into an issue while following the tutorial, feel free to reach out to me on or ask for help on our 💙 LinkedIn forum Previously published at https://medium.com/n8n-io/http-request-node-the-swiss-army-knife-b14e22283383