{"id":96790,"date":"2020-05-14T15:08:17","date_gmt":"2020-05-14T15:08:17","guid":{"rendered":"https:\/\/randomnerdtutorials.com\/?p=96790"},"modified":"2022-10-27T13:55:25","modified_gmt":"2022-10-27T13:55:25","slug":"esp32-http-get-open-weather-map-thingspeak-arduino","status":"publish","type":"post","link":"https:\/\/randomnerdtutorials.com\/esp32-http-get-open-weather-map-thingspeak-arduino\/","title":{"rendered":"ESP32 HTTP GET with Arduino IDE (OpenWeatherMap.org and ThingSpeak)"},"content":{"rendered":"\n<p>In this guide, you&#8217;ll learn how to make HTTP GET requests using the ESP32 board with Arduino IDE. We&#8217;ll demonstrate how to decode JSON data from OpenWeatherMap.org and plot values in charts using ThingSpeak.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" fetchpriority=\"high\" decoding=\"async\" width=\"1200\" height=\"675\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/ESP32-HTTP-GET-with-Arduino-IDE-OpenWeatherMap-ThingSpeak.jpg?resize=1200%2C675&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32 HTTP GET with Arduino IDE OpenWeatherMap ThingSpeak\" class=\"wp-image-96786\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/ESP32-HTTP-GET-with-Arduino-IDE-OpenWeatherMap-ThingSpeak.jpg?w=1280&amp;quality=100&amp;strip=all&amp;ssl=1 1280w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/ESP32-HTTP-GET-with-Arduino-IDE-OpenWeatherMap-ThingSpeak.jpg?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/ESP32-HTTP-GET-with-Arduino-IDE-OpenWeatherMap-ThingSpeak.jpg?resize=1024%2C576&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/ESP32-HTTP-GET-with-Arduino-IDE-OpenWeatherMap-ThingSpeak.jpg?resize=768%2C432&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/figure><\/div>\n\n\n<p><strong>Recommended:<\/strong> <a href=\"https:\/\/randomnerdtutorials.com\/esp32-http-post-ifttt-thingspeak-arduino\/\">ESP32 HTTP POST with Arduino IDE (ThingSpeak and IFTTT.com)<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">HTTP GET Request Method<\/h2>\n\n\n\n<p>The Hypertext Transfer Protocol (HTTP) works as a request-response protocol between a client and server. Here&#8217;s an example:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The ESP32 (client) submits an HTTP request to a Server (for example: OpenWeatherMap.org or ThingSpeak);<\/li><li>The server returns a response to the ESP32 (client);<\/li><li>Finally, the response contains status information about the request and may also contain the requested content.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">HTTP GET<\/h3>\n\n\n\n<p><strong>GET <\/strong>is used to request data from a specified resource. It is often used to get values from APIs.<\/p>\n\n\n\n<p>For example, you can use a simple request to return a value or JSON object:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>GET \/weather?countryCode=PT<\/code><\/pre>\n\n\n\n<p>Additionally, you can also make a GET request to update a value (like with ThingSpeak). For example, you can use:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>GET \/update?field1=value1<\/code><\/pre>\n\n\n\n<p>Note that the query string (<em>name = field1<\/em> and <em>value = value1<\/em>) is sent in the URL of the HTTP GET request.<\/p>\n\n\n\n<p><em>(With HTTP GET, data is visible to everyone in the URL request.)<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p>Before proceeding with this tutorial, make sure you complete the following prerequisites.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Arduino IDE<\/h3>\n\n\n\n<p>We&#8217;ll program the <a href=\"https:\/\/makeradvisor.com\/tools\/esp32-dev-board-wi-fi-bluetooth\/\" target=\"_blank\" rel=\"noreferrer noopener\">ESP32 <\/a>using Arduino IDE, so make sure you have the ESP32 add-on installed.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/randomnerdtutorials.com\/installing-the-esp32-board-in-arduino-ide-windows-instructions\/\">Installing the ESP32 Board in Arduino IDE (Windows, Mac OS X, Linux)<\/a><\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Arduino_JSON Library<\/h3>\n\n\n\n<p>You also need to install the&nbsp;<a href=\"https:\/\/github.com\/arduino-libraries\/Arduino_JSON\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\" (opens in a new tab)\">Arduino_JSON library<\/a>. You can install this library in the Arduino IDE Library Manager. Just go to&nbsp;<strong>Sketch&nbsp;<\/strong>&gt;&nbsp;<strong>Include Library<\/strong>&nbsp;&gt;&nbsp;<strong>Manage Libraries<\/strong>&nbsp;and search for the library name as follows:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"786\" height=\"443\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/Install-Arduino-JSON-library-Arduino-IDE.png?resize=786%2C443&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"Install Arduino JSON library Arduino IDE\" class=\"wp-image-93172\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/Install-Arduino-JSON-library-Arduino-IDE.png?w=786&amp;quality=100&amp;strip=all&amp;ssl=1 786w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/Install-Arduino-JSON-library-Arduino-IDE.png?resize=300%2C169&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/01\/Install-Arduino-JSON-library-Arduino-IDE.png?resize=768%2C433&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 786px) 100vw, 786px\" \/><\/figure><\/div>\n\n\n<h2 class=\"wp-block-heading\">Other Web Services or APIs<\/h2>\n\n\n\n<p>In this guide, you&#8217;ll learn how to setup your <a rel=\"noreferrer noopener\" href=\"https:\/\/makeradvisor.com\/tools\/esp32-dev-board-wi-fi-bluetooth\/\" target=\"_blank\">ESP32 board<\/a> to perform HTTP requests to OpenWeatherMap.org and ThingSpeak. If you prefer to learn with a local solution you can use <a href=\"https:\/\/randomnerdtutorials.com\/esp32-http-get-post-arduino\/\">HTTP with Node-RED<\/a>. All examples presented in this guide also work with other APIs.<\/p>\n\n\n\n<p>In summary, to make this guide compatible with any service, you need to search for the service API documentation. Then, you need the server name (URL or IP address), and parameters to send in the request (URL path or request body). Finally, modify our examples to integrate with any API you want to use.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. ESP32 HTTP GET: JSON Data (OpenWeatherMap.org)<\/h2>\n\n\n\n<p>In this example you\u2019ll learn how to make API requests to access data. As an example, we\u2019ll use the OpenWeatherMap API. This API has a free plan and provides lots of useful information about the weather in almost any location in the world.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"900\" height=\"414\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/HTTP-GET-Open-Weather-Map-ESP32.png?resize=900%2C414&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"HTTP GET Open Weather Map ESP32\" class=\"wp-image-96807\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/HTTP-GET-Open-Weather-Map-ESP32.png?w=900&amp;quality=100&amp;strip=all&amp;ssl=1 900w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/HTTP-GET-Open-Weather-Map-ESP32.png?resize=300%2C138&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/HTTP-GET-Open-Weather-Map-ESP32.png?resize=768%2C353&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\">Using OpenWeatherMap API<\/h3>\n\n\n\n<p>An application programming interface (API) is a set of functions written by software developers to enable anyone to use their data or services. The <a href=\"https:\/\/openweathermap.org\/\" target=\"_blank\" rel=\"noopener\">OpenWeatherMap<\/a> project has an API that enables users to request weather data.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/logo.png?resize=293%2C124&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"OpenWeatherMap API logo\" class=\"wp-image-96800\" width=\"293\" height=\"124\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/logo.png?w=600&amp;quality=100&amp;strip=all&amp;ssl=1 600w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/logo.png?resize=300%2C128&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 293px) 100vw, 293px\" \/><\/figure><\/div>\n\n\n<p>In this project, you\u2019ll use that API to request the day\u2019s weather forecast for your chosen location. Learning to use APIs is a great skill because it allows you access to a wide variety of constantly changing information, such as current stock prices, currency exchange rates, the latest news, traffic updates, tweets, and much more.<\/p>\n\n\n\n<p><strong>Note: <\/strong> API keys are unique to the user and shouldn\u2019t be shared with anyone.<\/p>\n\n\n\n<p>OpenWeatherMap\u2019s free plan provides everything you need to complete this project. To use the API you need an API key, known as the APIID. To get the APIID:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Open a browser and go to <a rel=\"noreferrer noopener\" href=\"https:\/\/openweathermap.org\/appid\/\" target=\"_blank\">https:\/\/openweathermap.org\/appid\/<\/a><\/li><li>Press the <strong>Sign up<\/strong> button and create a free account.<\/li><li>Go to this link: <a href=\"https:\/\/home.openweathermap.org\/api_keys\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/home.openweathermap.org\/api_keys<\/a> and get your API key.<\/li><\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"799\" height=\"421\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/openweathermap-key.png?resize=799%2C421&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"OpenWeatherMap API Key Copy\" class=\"wp-image-96799\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/openweathermap-key.png?w=799&amp;quality=100&amp;strip=all&amp;ssl=1 799w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/openweathermap-key.png?resize=300%2C158&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/openweathermap-key.png?resize=768%2C405&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 799px) 100vw, 799px\" \/><\/figure><\/div>\n\n\n<ol class=\"wp-block-list\" start=\"4\"><li>On the <strong>API keys<\/strong> tab, you\u2019ll see a default key (highlighted in a red rectangle in figure above); this is a unique key you\u2019ll need to pull information from the site. Copy and paste this key somewhere; you\u2019ll need it in a moment.<\/li><li>To pull information on weather in your chosen location, enter the following URL:<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>http:&#47;&#47;api.openweathermap.org\/data\/2.5\/weather?q=yourCityName,yourCountryCode&amp;APPID=yourUniqueAPIkey<\/code><\/pre>\n\n\n\n<p>Replace <strong>yourCityName<\/strong> with the city you want data for, <strong>yourCountryCode <\/strong>with the country code for that city, and <strong>yourUniqueAPIkey<\/strong> with the unique API key from step 4. For example, the updated API URL for the city of Porto, Portugal, would be: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:&#47;&#47;api.openweathermap.org\/data\/2.5\/weather?q=Porto,\nPT&amp;APPID=801d2603e9f2e1c70e042e4f5f6e0---<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\" start=\"6\"><li>Copy your URL into your browser, and the API will return a bunch of information corresponding to your local weather. We got the following information about the weather in Porto, Portugal, on the day we wrote this tutorial.<\/li><\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>{\"coord\":{\"lon\":-8.611,\"lat\":41.1496},\"weather\":&#091;{\"id\":803,\"main\":\"Clouds\",\"description\":\"broken clouds\",\"icon\":\"04d\"}],\"base\":\"stations\",\"main\":{\"temp\":294.58,\"feels_like\":294.95,\"temp_min\":293.82,\"temp_max\":295.65,\"pressure\":1016,\"humidity\":83},\"visibility\":10000,\"wind\":{\"speed\":8.94,\"deg\":180,\"gust\":8.94},\"clouds\":{\"all\":75},\"dt\":1666877635,\"sys\":{\"type\":2,\"id\":2009460,\"country\":\"PT\",\"sunrise\":1666853957,\"sunset\":1666892227},\"timezone\":3600,\"id\":2735943,\"name\":\"Porto\",\"cod\":200}<\/code><\/pre>\n\n\n\n<p>This is how it looks with indentation for better readability. <\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>{\n  \"coord\": {\n    \"lon\": -8.611,\n    \"lat\": 41.1496\n  },\n  \"weather\": &#091;\n    {\n      \"id\": 803,\n      \"main\": \"Clouds\",\n      \"description\": \"broken clouds\",\n      \"icon\": \"04d\"\n    }\n  ],\n  \"base\": \"stations\",\n  \"main\": {\n    \"temp\": 294.58,\n    \"feels_like\": 294.95,\n    \"temp_min\": 293.82,\n    \"temp_max\": 295.65,\n    \"pressure\": 1016,\n    \"humidity\": 83\n  },\n  \"visibility\": 10000,\n  \"wind\": {\n    \"speed\": 8.94,\n    \"deg\": 180,\n    \"gust\": 8.94\n  },\n  \"clouds\": {\n    \"all\": 75\n  },\n  \"dt\": 1666877635,\n  \"sys\": {\n    \"type\": 2,\n    \"id\": 2009460,\n    \"country\": \"PT\",\n    \"sunrise\": 1666853957,\n    \"sunset\": 1666892227\n  },\n  \"timezone\": 3600,\n  \"id\": 2735943,\n  \"name\": \"Porto\",\n  \"cod\": 200\n}<\/code><\/pre>\n\n\n\n<p>Next, you\u2019ll see how to use this information to get specific data like temperature, humidity, pressure, wind speed, etc.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Code ESP32 HTTP GET OpenWeatherMap.org<\/h3>\n\n\n\n<p>After installing the necessary board add-ons and libraries, copy the following code to your Arduino IDE, but don\u2019t upload it yet. You need to make some changes to make it work for you.<\/p>\n\n\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">\/*\r\n  Rui Santos\r\n  Complete project details at Complete project details at https:\/\/RandomNerdTutorials.com\/esp32-http-get-open-weather-map-thingspeak-arduino\/\r\n\r\n  Permission is hereby granted, free of charge, to any person obtaining a copy\r\n  of this software and associated documentation files.\r\n\r\n  The above copyright notice and this permission notice shall be included in all\r\n  copies or substantial portions of the Software.\r\n*\/\r\n\r\n#include &lt;WiFi.h&gt;\r\n#include &lt;HTTPClient.h&gt;\r\n#include &lt;Arduino_JSON.h&gt;\r\n\r\nconst char* ssid = &quot;REPLACE_WITH_YOUR_SSID&quot;;\r\nconst char* password = &quot;REPLACE_WITH_YOUR_PASSWORD&quot;;\r\n\r\n\/\/ Your Domain name with URL path or IP address with path\r\nString openWeatherMapApiKey = &quot;REPLACE_WITH_YOUR_OPEN_WEATHER_MAP_API_KEY&quot;;\r\n\/\/ Example:\r\n\/\/String openWeatherMapApiKey = &quot;bd939aa3d23ff33d3c8f5dd1dd435&quot;;\r\n\r\n\/\/ Replace with your country code and city\r\nString city = &quot;Porto&quot;;\r\nString countryCode = &quot;PT&quot;;\r\n\r\n\/\/ THE DEFAULT TIMER IS SET TO 10 SECONDS FOR TESTING PURPOSES\r\n\/\/ For a final application, check the API call limits per hour\/minute to avoid getting blocked\/banned\r\nunsigned long lastTime = 0;\r\n\/\/ Timer set to 10 minutes (600000)\r\n\/\/unsigned long timerDelay = 600000;\r\n\/\/ Set timer to 10 seconds (10000)\r\nunsigned long timerDelay = 10000;\r\n\r\nString jsonBuffer;\r\n\r\nvoid setup() {\r\n  Serial.begin(115200);\r\n\r\n  WiFi.begin(ssid, password);\r\n  Serial.println(&quot;Connecting&quot;);\r\n  while(WiFi.status() != WL_CONNECTED) {\r\n    delay(500);\r\n    Serial.print(&quot;.&quot;);\r\n  }\r\n  Serial.println(&quot;&quot;);\r\n  Serial.print(&quot;Connected to WiFi network with IP Address: &quot;);\r\n  Serial.println(WiFi.localIP());\r\n \r\n  Serial.println(&quot;Timer set to 10 seconds (timerDelay variable), it will take 10 seconds before publishing the first reading.&quot;);\r\n}\r\n\r\nvoid loop() {\r\n  \/\/ Send an HTTP GET request\r\n  if ((millis() - lastTime) &gt; timerDelay) {\r\n    \/\/ Check WiFi connection status\r\n    if(WiFi.status()== WL_CONNECTED){\r\n      String serverPath = &quot;http:\/\/api.openweathermap.org\/data\/2.5\/weather?q=&quot; + city + &quot;,&quot; + countryCode + &quot;&amp;APPID=&quot; + openWeatherMapApiKey;\r\n      \r\n      jsonBuffer = httpGETRequest(serverPath.c_str());\r\n      Serial.println(jsonBuffer);\r\n      JSONVar myObject = JSON.parse(jsonBuffer);\r\n  \r\n      \/\/ JSON.typeof(jsonVar) can be used to get the type of the var\r\n      if (JSON.typeof(myObject) == &quot;undefined&quot;) {\r\n        Serial.println(&quot;Parsing input failed!&quot;);\r\n        return;\r\n      }\r\n    \r\n      Serial.print(&quot;JSON object = &quot;);\r\n      Serial.println(myObject);\r\n      Serial.print(&quot;Temperature: &quot;);\r\n      Serial.println(myObject[&quot;main&quot;][&quot;temp&quot;]);\r\n      Serial.print(&quot;Pressure: &quot;);\r\n      Serial.println(myObject[&quot;main&quot;][&quot;pressure&quot;]);\r\n      Serial.print(&quot;Humidity: &quot;);\r\n      Serial.println(myObject[&quot;main&quot;][&quot;humidity&quot;]);\r\n      Serial.print(&quot;Wind Speed: &quot;);\r\n      Serial.println(myObject[&quot;wind&quot;][&quot;speed&quot;]);\r\n    }\r\n    else {\r\n      Serial.println(&quot;WiFi Disconnected&quot;);\r\n    }\r\n    lastTime = millis();\r\n  }\r\n}\r\n\r\nString httpGETRequest(const char* serverName) {\r\n  WiFiClient client;\r\n  HTTPClient http;\r\n    \r\n  \/\/ Your Domain name with URL path or IP address with path\r\n  http.begin(client, serverName);\r\n  \r\n  \/\/ Send HTTP POST request\r\n  int httpResponseCode = http.GET();\r\n  \r\n  String payload = &quot;{}&quot;; \r\n  \r\n  if (httpResponseCode&gt;0) {\r\n    Serial.print(&quot;HTTP Response code: &quot;);\r\n    Serial.println(httpResponseCode);\r\n    payload = http.getString();\r\n  }\r\n  else {\r\n    Serial.print(&quot;Error code: &quot;);\r\n    Serial.println(httpResponseCode);\r\n  }\r\n  \/\/ Free resources\r\n  http.end();\r\n\r\n  return payload;\r\n}\r\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/Random-Nerd-Tutorials\/raw\/master\/Projects\/ESP32\/HTTP\/ESP32_HTTP_GET_Open_Weather_Map.ino\" target=\"_blank\">View raw code<\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Setting your network credentials<\/h4>\n\n\n\n<p>Modify the next lines with your network credentials: SSID and password. The code is well commented on where you should make the changes.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>\/\/ Replace with your network credentials\nconst char* ssid     = \"REPLACE_WITH_YOUR_SSID\";\nconst char* password = \"REPLACE_WITH_YOUR_PASSWORD\";<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Setting your OpenWeatherMap.org API Key<\/h4>\n\n\n\n<p>Insert your API key in the following like:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>String openWeatherMapApiKey = \"REPLACE_WITH_YOUR_OPEN_WEATHER_MAP_API_KEY\";<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Setting your city and country<\/h4>\n\n\n\n<p>Enter the city you want to get data for, as well as the country code in the following variables:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>\/\/ Replace with your country code and city\nString city = \"Porto\";\nString countryCode = \"PT\";<\/code><\/pre>\n\n\n\n<p>After making these changes, you can upload the code to your board. Continue reading to learn how the code works.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">HTTP GET Request (JSON Object)<\/h3>\n\n\n\n<p>In the <span class=\"rnthl rntliteral\">loop()<\/span>, call the <span class=\"rnthl rntliteral\">httpGETRequest()<\/span> function to make the HTTP GET request:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>String serverPath = \"http:\/\/api.openweathermap.org\/data\/2.5\/weather?q=\" + city + \",\" + countryCode + \"&amp;APPID=\" + openWeatherMapApiKey;\n\njsonBuffer = httpGETRequest(serverPath.c_str());<\/code><\/pre>\n\n\n\n<p>The <span class=\"rnthl rntliteral\">httpGETRequest()<\/span> function makes a request to OpenWeatherMap and it retrieves a string with a JSON object that contains all the information about the weather for your city.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>String httpGETRequest(const char* serverName) {\n  HTTPClient http;\n\n  \/\/ Your IP address with path or Domain name with URL path \n  http.begin(serverName);\n\n  \/\/ Send HTTP POST request\n  int httpResponseCode = http.GET();\n\n  String payload = \"{}\"; \n\n  if (httpResponseCode&gt;0) {\n    Serial.print(\"HTTP Response code: \");\n    Serial.println(httpResponseCode);\n    payload = http.getString();\n  }\n  else {\n    Serial.print(\"Error code: \");\n    Serial.println(httpResponseCode);\n  }\n  \/\/ Free resources\n  http.end();\n\n  return payload;\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Decoding JSON Object<\/h3>\n\n\n\n<p>To get access to the values, decode the JSON object and store all values in the <span class=\"rnthl rntliteral\">jsonBuffer<\/span> array.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>JSONVar myObject = JSON.parse(jsonBuffer);\n\/\/ JSON.typeof(jsonVar) can be used to get the type of the var\n\nif (JSON.typeof(myObject) == \"undefined\") {\n  Serial.println(\"Parsing input failed!\");\n  return;\n}\n\nSerial.print(\"JSON object = \");\nSerial.println(myObject);\nSerial.print(\"Temperature: \");\nSerial.println(myObject&#091;\"main\"]&#091;\"temp\"]);\nSerial.print(\"Pressure: \");\nSerial.println(myObject&#091;\"main\"]&#091;\"pressure\"]);\nSerial.print(\"Humidity: \");\nSerial.println(myObject&#091;\"main\"]&#091;\"humidity\"]);\nSerial.print(\"Wind Speed: \");\nSerial.println(myObject&#091;\"wind\"]&#091;\"speed\"]);<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">HTTP GET Demonstration<\/h3>\n\n\n\n<p>After uploading the code, open the Serial Monitor and you&#8217;ll see that it&#8217;s receiving the following JSON data:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\"coord\":{\"lon\":-8.61,\"lat\":41.15},\"weather\":&#091;{\"id\":801,\"main\":\"Clouds\",\"description\":\"few clouds\",\"icon\":\"02d\"}],\"base\":\"stations\",\"main\":{\"temp\":294.44,\"feels_like\":292.82,\"temp_min\":292.15,\"temp_max\":297.04,\"pressure\":1008,\"humidity\":63},\"visibility\":10000,\"wind\":{\"speed\":4.1,\"deg\":240},\"clouds\":{\"all\":20},\"dt\":1589288330,\"sys\":{\"type\":1,\"id\":6900,\"country\":\"PT\",\"sunrise\":1589260737,\"sunset\":1589312564},\"timezone\":3600,\"id\":2735943,\"name\":\"Porto\",\"cod\":200}<\/code><\/pre>\n\n\n\n<p>Then, it prints the decoded JSON object in the Arduino IDE Serial Monitor to get the temperature (in Kelvin), pressure, humidity and wind speed values.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"897\" height=\"739\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/ESP32-ESP8266-NodeMCU-HTTP-GET-with-Arduino-IDE-OpenWeatherMap-Response.png?resize=897%2C739&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32 ESP8266 NodeMCU HTTP GET with Arduino IDE OpenWeatherMap Response\" class=\"wp-image-96783\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/ESP32-ESP8266-NodeMCU-HTTP-GET-with-Arduino-IDE-OpenWeatherMap-Response.png?w=897&amp;quality=100&amp;strip=all&amp;ssl=1 897w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/ESP32-ESP8266-NodeMCU-HTTP-GET-with-Arduino-IDE-OpenWeatherMap-Response.png?resize=300%2C247&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/ESP32-ESP8266-NodeMCU-HTTP-GET-with-Arduino-IDE-OpenWeatherMap-Response.png?resize=768%2C633&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 897px) 100vw, 897px\" \/><\/figure><\/div>\n\n\n<p>For demonstration purposes, we&#8217;re requesting new data every 10 seconds. However, for a long term project you should increase the timer or check the API call limits per hour\/minute to avoid getting blocked\/banned.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. ESP32 HTTP GET: Update Value (ThingSpeak)<\/h2>\n\n\n\n<p>In this example, the ESP32 makes an HTTP GET request to update a reading in ThingSpeak.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"353\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/HTTP-GET-Thingspeak-ESP32.png?resize=900%2C353&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"HTTP GET ThingSpeak ESP32\" class=\"wp-image-96809\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/HTTP-GET-Thingspeak-ESP32.png?w=900&amp;quality=100&amp;strip=all&amp;ssl=1 900w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/HTTP-GET-Thingspeak-ESP32.png?resize=300%2C118&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/HTTP-GET-Thingspeak-ESP32.png?resize=768%2C301&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\">Using ThingSpeak API<\/h3>\n\n\n\n<p>ThingSpeak has a free API that allows you to store and retrieve data using HTTP. In this tutorial, you\u2019ll use the ThingSpeak API to publish and visualize data in charts from anywhere. As an example, we&#8217;ll publish random values, but in a real application you would use real <a href=\"https:\/\/randomnerdtutorials.com\/esp32-bme280-arduino-ide-pressure-temperature-humidity\/\">sensor readings<\/a>.<\/p>\n\n\n\n<p>To use ThingSpeak with your ESP, you need an API key. Follow the next steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Go to <a rel=\"noreferrer noopener\" href=\"https:\/\/thingspeak.com\/\" target=\"_blank\">ThingSpeak.com<\/a> and create a free account.<\/li><li>Then, open the <a rel=\"noreferrer noopener\" href=\"https:\/\/thingspeak.com\/channels\" target=\"_blank\">Channels<\/a> tab.<\/li><li>Create a <strong>New Channel<\/strong>.<\/li><\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"453\" height=\"326\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/ESP32-ESP8266-NodeMCU-ThingSpeak-New-Channel.png?resize=453%2C326&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32 ESP8266 NodeMCU ThingSpeak Create New Channel\" class=\"wp-image-96802\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/ESP32-ESP8266-NodeMCU-ThingSpeak-New-Channel.png?w=453&amp;quality=100&amp;strip=all&amp;ssl=1 453w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/ESP32-ESP8266-NodeMCU-ThingSpeak-New-Channel.png?resize=300%2C216&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 453px) 100vw, 453px\" \/><\/figure><\/div>\n\n\n<ol start=\"4\"><li>Open your newly created channel and select the <strong>API Keys<\/strong> tab to copy your Write API Key.<\/li><\/ol>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"628\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/ESP32-ESP8266-NodeMCU-ThingSpeak-View-API-Key-Write-Copy.png?resize=1024%2C628&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32 ESP8266 NodeMCU ThingSpeak View API Key Write Copy\" class=\"wp-image-96803\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/ESP32-ESP8266-NodeMCU-ThingSpeak-View-API-Key-Write-Copy.png?w=1024&amp;quality=100&amp;strip=all&amp;ssl=1 1024w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/ESP32-ESP8266-NodeMCU-ThingSpeak-View-API-Key-Write-Copy.png?resize=300%2C184&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/ESP32-ESP8266-NodeMCU-ThingSpeak-View-API-Key-Write-Copy.png?resize=768%2C471&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<h3 class=\"wp-block-heading\">Code ESP32 HTTP GET ThingSpeak<\/h3>\n\n\n\n<p>Copy the next sketch to your Arduino IDE (type your SSID, password, and API Key):<\/p>\n\n\n<pre style=\"max-height: 40em; margin-bottom: 20px;\"><code class=\"language-c\">\/*\r\n  Rui Santos\r\n  Complete project details at Complete project details at https:\/\/RandomNerdTutorials.com\/esp32-http-get-open-weather-map-thingspeak-arduino\/\r\n\r\n  Permission is hereby granted, free of charge, to any person obtaining a copy\r\n  of this software and associated documentation files.\r\n\r\n  The above copyright notice and this permission notice shall be included in all\r\n  copies or substantial portions of the Software.\r\n*\/\r\n\r\n#include &lt;WiFi.h&gt;\r\n#include &lt;HTTPClient.h&gt;\r\n\r\nconst char* ssid = &quot;REPLACE_WITH_YOUR_SSID&quot;;\r\nconst char* password = &quot;REPLACE_WITH_YOUR_PASSWORD&quot;;\r\n\r\n\/\/ REPLACE WITH THINGSPEAK.COM API KEY\r\nString serverName = &quot;http:\/\/api.thingspeak.com\/update?api_key=REPLACE_WITH_YOUR_API_KEY&quot;;\r\n\/\/ EXAMPLE:\r\n\/\/String serverName = &quot;http:\/\/api.thingspeak.com\/update?api_key=7HQJM49R8JAPR&quot;;\r\n\r\n\/\/ THE DEFAULT TIMER IS SET TO 10 SECONDS FOR TESTING PURPOSES\r\n\/\/ For a final application, check the API call limits per hour\/minute to avoid getting blocked\/banned\r\nunsigned long lastTime = 0;\r\n\/\/ Timer set to 10 minutes (600000)\r\n\/\/unsigned long timerDelay = 600000;\r\n\/\/ Set timer to 10 seconds (10000)\r\nunsigned long timerDelay = 10000;\r\n\r\nvoid setup() {\r\n  Serial.begin(115200); \r\n\r\n  WiFi.begin(ssid, password);\r\n  Serial.println(&quot;Connecting&quot;);\r\n  while(WiFi.status() != WL_CONNECTED) {\r\n    delay(500);\r\n    Serial.print(&quot;.&quot;);\r\n  }\r\n  Serial.println(&quot;&quot;);\r\n  Serial.print(&quot;Connected to WiFi network with IP Address: &quot;);\r\n  Serial.println(WiFi.localIP());\r\n \r\n  Serial.println(&quot;Timer set to 10 seconds (timerDelay variable), it will take 10 seconds before publishing the first reading.&quot;);\r\n  \r\n  \/\/ Random seed is a number used to initialize a pseudorandom number generator\r\n  randomSeed(analogRead(33));\r\n}\r\n\r\nvoid loop() {\r\n  \/\/ Send an HTTP GET request\r\n  if ((millis() - lastTime) &gt; timerDelay) {\r\n    \/\/ Check WiFi connection status\r\n    if(WiFi.status()== WL_CONNECTED){\r\n      WiFiClient client;\r\n      HTTPClient http;\r\n\r\n      String serverPath = serverName + &quot;&amp;field1=&quot; + String(random(40));\r\n      \r\n      \/\/ Your Domain name with URL path or IP address with path\r\n      http.begin(client, serverPath.c_str());\r\n      \r\n      \/\/ Send HTTP GET request\r\n      int httpResponseCode = http.GET();\r\n      \r\n      if (httpResponseCode&gt;0) {\r\n        Serial.print(&quot;HTTP Response code: &quot;);\r\n        Serial.println(httpResponseCode);\r\n        String payload = http.getString();\r\n        Serial.println(payload);\r\n      }\r\n      else {\r\n        Serial.print(&quot;Error code: &quot;);\r\n        Serial.println(httpResponseCode);\r\n      }\r\n      \/\/ Free resources\r\n      http.end();\r\n    }\r\n    else {\r\n      Serial.println(&quot;WiFi Disconnected&quot;);\r\n    }\r\n    lastTime = millis();\r\n  }\r\n}\r\n<\/code><\/pre>\n\t<p style=\"text-align:center\"><a class=\"rntwhite\" href=\"https:\/\/github.com\/RuiSantosdotme\/Random-Nerd-Tutorials\/raw\/master\/Projects\/ESP32\/HTTP\/ESP32_HTTP_GET_Think_Speak.ino\" target=\"_blank\">View raw code<\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Setting your network credentials<\/h4>\n\n\n\n<p>Modify the next lines with your network credentials: SSID and password. The code is well commented on where you should make the changes.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>\/\/ Replace with your network credentials\nconst char* ssid     = \"REPLACE_WITH_YOUR_SSID\";\nconst char* password = \"REPLACE_WITH_YOUR_PASSWORD\";<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Setting your serverName (API Key)<\/h4>\n\n\n\n<p>Modify the <span class=\"rnthl rntliteral\">serverName<\/span> variable to include your API key.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>String serverName = \"http:\/\/api.thingspeak.com\/update?api_key=REPLACE_WITH_YOUR_API_KEY\";<\/code><\/pre>\n\n\n\n<p>Now, upload the code to your board and it should work straight away. Read the next section, if you want to learn how to make the HTTP GET request.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">HTTP GET Request<\/h4>\n\n\n\n<p>In the <span class=\"rnthl rntliteral\">loop()<\/span> is where you make the HTTP GET request every 10 seconds with random values:<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>String serverPath = serverName + \"&amp;field1=\" + String(random(40));\n\n\/\/ Your Domain name with URL path or IP address with path\nhttp.begin(serverPath.c_str());\n\n\/\/ Send HTTP GET request\nint httpResponseCode = http.GET();<\/code><\/pre>\n\n\n\n<p>The ESP32 makes a new request in the following URL to update the sensor <span class=\"rnthl rntliteral\">field1<\/span> with a new value (<span class=\"rnthl rntliteral\">30<\/span>). <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:&#47;&#47;api.thingspeak.com\/update?api_key=REPLACE_WITH_YOUR_API_KEY&amp;field1=30<\/code><\/pre>\n\n\n\n<p>Then, the following lines of code save the HTTP response from the server.<\/p>\n\n\n\n<pre class=\"wp-block-code language-c\"><code>if (httpResponseCode&gt;0) {\n  Serial.print(\"HTTP Response code: \");\n  Serial.println(httpResponseCode);\n  String payload = http.getString();\n  Serial.println(payload);\n}\nelse {\n  Serial.print(\"Error code: \");\n  Serial.println(httpResponseCode);\n}<\/code><\/pre>\n\n\n\n<p>In the Arduino IDE serial monitor, you should see an HTTP response code of 200 (this means that the request has succeeded).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"903\" height=\"589\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/ESP32-ESP8266-NodeMCU-HTTP-POST-Arduino-IDE-Serial-Monitor-Response.png?resize=903%2C589&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32 ESP8266 NodeMCU HTTP POST Arduino IDE Serial Monitor Response\" class=\"wp-image-96785\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/ESP32-ESP8266-NodeMCU-HTTP-POST-Arduino-IDE-Serial-Monitor-Response.png?w=903&amp;quality=100&amp;strip=all&amp;ssl=1 903w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/ESP32-ESP8266-NodeMCU-HTTP-POST-Arduino-IDE-Serial-Monitor-Response.png?resize=300%2C196&amp;quality=100&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/ESP32-ESP8266-NodeMCU-HTTP-POST-Arduino-IDE-Serial-Monitor-Response.png?resize=768%2C501&amp;quality=100&amp;strip=all&amp;ssl=1 768w\" sizes=\"(max-width: 903px) 100vw, 903px\" \/><\/figure><\/div>\n\n\n<p>Your ThingSpeak Dashboard (under the <em>Private View <\/em>tab) should be receiving new readings every 10 seconds.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"463\" height=\"314\" src=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/ESP32-ESP8266-NodeMCU-HTTP-GET-POST-ThingSpeak-chart.png?resize=463%2C314&#038;quality=100&#038;strip=all&#038;ssl=1\" alt=\"ESP32 ESP8266 NodeMCU HTTP GET and HTTP POST with Arduino IDE ThingSpeak Chart\" class=\"wp-image-96806\" srcset=\"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/ESP32-ESP8266-NodeMCU-HTTP-GET-POST-ThingSpeak-chart.png?w=463&amp;quality=100&amp;strip=all&amp;ssl=1 463w, https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/ESP32-ESP8266-NodeMCU-HTTP-GET-POST-ThingSpeak-chart.png?resize=300%2C203&amp;quality=100&amp;strip=all&amp;ssl=1 300w\" sizes=\"(max-width: 463px) 100vw, 463px\" \/><\/figure><\/div>\n\n\n<p>For a final application, you might need to increase the timer or check the API call limits per hour\/minute to avoid getting blocked\/banned.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Wrapping Up<\/h2>\n\n\n\n<p>In this tutorial you&#8217;ve learned how to integrate your ESP32 with web services using HTTP GET requests. You can also make <a href=\"https:\/\/randomnerdtutorials.com\/esp32-http-post-ifttt-thingspeak-arduino\/\">HTTP POST requests with the ESP32<\/a>.<\/p>\n\n\n\n<p>If you&#8217;re using an ESP8266 board, read:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/randomnerdtutorials.com\/esp8266-nodemcu-http-get-open-weather-map-thingspeak-arduino\/\">Guide for ESP8266 NodeMCU HTTP GET Request<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/esp8266-nodemcu-http-post-ifttt-thingspeak-arduino\/\">Guide for ESP8266 NodeMCU HTTP POST Request<\/a><\/li><\/ul>\n\n\n\n<p><strong>You might also like reading:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong><a href=\"https:\/\/randomnerdtutorials.com\/learn-esp32-with-arduino-ide\/\">[Course] <\/a><\/strong><span><strong><a href=\"https:\/\/randomnerdtutorials.com\/learn-esp32-with-arduino-ide\/\">Learn ESP32 with Arduino IDE<\/a><\/strong><\/span><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-esp8266-send-email-notification\/\">ESP32\/ESP8266 Send Email Notification using PHP Script<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/visualize-esp32-esp8266-sensor-readings-from-anywhere\/\">Visualize Your Sensor Readings from Anywhere in the World<\/a><\/li><li><a href=\"https:\/\/randomnerdtutorials.com\/esp32-relay-module-ac-web-server\/\">ESP32 Relay Module Web Server<\/a><\/li><\/ul>\n\n\n\n<p>I hope you liked this project. If you have any questions, post a comment below and we&#8217;ll try to get back to you.<\/p>\n\n\n\n<p class=\"rntbox rntclgray\">If you like ESP32, you might consider enrolling in our course &#8220;<a href=\"https:\/\/randomnerdtutorials.com\/learn-esp32-with-arduino-ide\/\">Learn ESP32 with Arduino IDE<\/a>&#8220;. You can also access our free <a href=\"https:\/\/randomnerdtutorials.com\/projects-esp32\/\">ESP32 resources here<\/a>. <\/p>\n\n\n\n<p>Thank you for reading.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this guide, you&#8217;ll learn how to make HTTP GET requests using the ESP32 board with Arduino IDE. We&#8217;ll demonstrate how to decode JSON data from OpenWeatherMap.org and plot values &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"ESP32 HTTP GET with Arduino IDE (OpenWeatherMap.org and ThingSpeak)\" class=\"read-more button\" href=\"https:\/\/randomnerdtutorials.com\/esp32-http-get-open-weather-map-thingspeak-arduino\/#more-96790\" aria-label=\"Read more about ESP32 HTTP GET with Arduino IDE (OpenWeatherMap.org and ThingSpeak)\">CONTINUE READING \u00bb<\/a><\/p>\n","protected":false},"author":1,"featured_media":96786,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[276,281,277,299,264],"tags":[],"class_list":["post-96790","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-esp32","category-esp32-project","category-esp32-arduino-ide","category-0-esp32","category-project"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/randomnerdtutorials.com\/wp-content\/uploads\/2020\/05\/ESP32-HTTP-GET-with-Arduino-IDE-OpenWeatherMap-ThingSpeak.jpg?fit=1280%2C720&quality=100&strip=all&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/96790","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/comments?post=96790"}],"version-history":[{"count":2,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/96790\/revisions"}],"predecessor-version":[{"id":120184,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/posts\/96790\/revisions\/120184"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media\/96786"}],"wp:attachment":[{"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/media?parent=96790"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/categories?post=96790"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomnerdtutorials.com\/wp-json\/wp\/v2\/tags?post=96790"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}