Thingspeak Library returns 0 using ESP8266 on Arduino
#include &lt;WiFi.h&gt;


From the WiFi library reference page:


  With the Arduino WiFi Shield, this library allows an Arduino board to connect to the internet.


From the Arduino WiFi Shield product page:


  It is based on the HDG204 Wireless LAN 802.11b/g System in-Package. An AT32UC3 provides a network (IP) stack capable of both TCP and UDP.


But you're not using an Arduino WiFi Shield or anything compatible. You're using an ESP8266 which is completely different. Thus you can't use the WiFi library for your project.

Instead you will need to use the appropriate ESP8266 library. If you are programming the ESP8266 directly that will be the ESP8266WiFi library, which is bundled with the ESP8266 core for Arduino. If you are using the ESP8266 as a WiFi module controlled via AT commands that will be the WiFiEsp library