weather station issues

Hi,

So I am here again, I am still strugling with my weather station.
Now I have connection to the server but sadly I can't parse my json.
Btw I am using an mkr1000 if that's matter.

My code is below:
Here is my "issue" (I printed "line" in serial monitor just to see what that actually gets and yea, there is the problem.
): Screenshot - db92e84c28451b9f20f697f6c495029d - Gyazo ; Screenshot - 8dbeb71023e0716dac10347846dd5484 - Gyazo

Please post your code here.
In code tags.
Why is that so hard to do?

Sorry It was already made.

    String line = "";

    while (client.connected())
    {
      line = client.readStringUntil('\n');

      //json buffer adat tarolas miatt
      StaticJsonBuffer<5000> jsonBuffer;
      JsonObject& root = jsonBuffer.parseObject(line);
      if (!root.success())
      {
        Serial.println("parseObject() sikertelen");
        return;
      }

      //adat lekeres json-bol
      String idojaras123 = root["current"]["temp_c"];
      nextWeather[0] = idojaras123;
      int idojaras = idojaras123.toInt();

      Serial.println(idojaras);

root["current"]["temp_c"]; A string literal as array index?

(When we say "post your code", we really mean it. All of it.

In my other program, it worked so I tought its going to work now too.
But the issues is probably the html code that I get with my “line” variable since I need a json data in that.

Well, here is my full code.

#include <ArduinoJson.h>
#include <Wire.h>
#include <SPI.h>
#include <NTPClient.h>
#include <WiFi101.h>
#include <WiFiUdp.h>
#include "Adafruit_LEDBackpack.h"
#include "Adafruit_GFX.h"

char *ssid = "ssid";
const char *password = "pw";

String apikey = "*myapikey*";
String varos = "Budapest";
char server[] = "api.apixu.com";
WiFiClient client;
String nextWeather[] = {" ", " ", " "};

int status = WL_IDLE_STATUS;

int szamlalo = 30000; //600000 = 10 perc //milyen surun kerek idojaras adatot
unsigned long mostani_ido = 0;

WiFiUDP ntpUDP;
NTPClient timeClient(ntpUDP);

int fenyero = 5;

Adafruit_7segment kijelzo = Adafruit_7segment();

void setup()
{
  kijelzo.begin(0x70);
  kijelzo.setBrightness(fenyero);
  Serial.begin(115200);
  Serial.print("Connecting to: ");
  Serial.println(ssid);
  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print("Varakozas a kapcsolodasra...");
  }
  timeClient.begin();
  timeClient.setTimeOffset(7200); //GMT+1 (7200) vagy +0, mert mar a faszom se tudja mibe van MO.
}


void loop()
{
  oraDolgai();
  idojarasDolgai();
  //kijelzo.writeDigitRaw(3, 0x63);  //celsiushoz fog kelleni
}


void oraDolgai()
{
  timeClient.update();
  String masodperc = ((timeClient.getFormattedTime().substring(6)));
  String perc = ((timeClient.getFormattedTime().substring(3)));
  String ora = ((timeClient.getFormattedTime().substring(0)));
  int masodpercc = masodperc.toInt();
  int oraa = ora.toInt();
  int percc = perc.toInt();

  unsigned int oraaa = oraa;
  unsigned int perccc = percc;
  unsigned int masodperccc = masodpercc;

  unsigned int ideiglenes = perccc;
  do
  {
    ideiglenes /= 10;
    oraaa *= 10;
  } while (ideiglenes > 0);

  if (perccc < 10)
  {
    unsigned int kisebb = oraaa * 10;
    unsigned int pontosido = kisebb + perccc;
    kijelzo.print(pontosido);
  }
  else
  {
    unsigned int pontosido2 = oraaa + perccc;
    kijelzo.print(pontosido2);
  }

  if (masodpercc % 2) {
    kijelzo.drawColon(false);
  }
  else
  {
    kijelzo.drawColon(true);
  }
  kijelzo.writeDisplay();
}

void idojarasDolgai()
{
  if (millis() > mostani_ido + szamlalo)
  {
    mostani_ido = millis();

    Serial.println("\nCsatlakozas a szerverhez...");
    if (client.connect(server, 80))
    {
      Serial.println("Csatlakozva a szerverhez.");
      // HTTP request kuldese az api szerver fele:
      client.println("GET /v1/current.json?key=" + apikey + "&q=" + varos);
      client.println(" HTTP/1.1\r\n");
      client.println("Host: api.apixu.com");
      client.println("Connection: close");
      client.println();
    }
    else
    {
      Serial.println("unable to connect");
    }
    //json adatbazis
    //http://api.apixu.com/v1/current.json?key=*myapikey*&q=Budapest

    String line = "";

    while (client.connected())
    {
      line = client.readStringUntil('\n');

      //json buffer adat tarolas miatt
      StaticJsonBuffer<5000> jsonBuffer;
      JsonObject& root = jsonBuffer.parseObject(line);
      if (!root.success())
      {
        Serial.println("parseObject() sikertelen");
        return;
      }

      //adat lekeres json-bol
      String idojaras123 = root["current"]["temp_c"];
      nextWeather[0] = idojaras123;
      int idojaras = idojaras123.toInt();

      Serial.println(idojaras);
    }
  }
}

AWOL:
root["current"]["temp_c"]; A string literal as array index?

It is obviously an overloaded [] operator of JsonObject class. There's nothing unusual in passing a string literal to an overloaded [].

I still don't understand why am I getting this html code back. Screenshot - db92e84c28451b9f20f697f6c495029d - Gyazo
Screenshot - 8dbeb71023e0716dac10347846dd5484 - Gyazo

Like as I said when I used a different api not this, my code was working just couldn't connect to the server.
Now I can connect but can't really get the data (probably because I don't really know this json library) but my line variable should contain something like this: {"cod":"200","message":0.0064,"cnt":3,"list":[{"dt":1556150400,"main":{"temp":11 - Pastebin.com not a html error code.

Blerkk:
I still don't understand why am I getting this html code back. Screenshot - db92e84c28451b9f20f697f6c495029d - Gyazo
Screenshot - 8dbeb71023e0716dac10347846dd5484 - Gyazo

Like as I said when I used a different api not this, my code was working just couldn't connect to the server.
Now I can connect but can't really get the data (probably because I don't really know this json library) but my line variable should contain something like this: {"cod":"200","message":0.0064,"cnt":3,"list":[{"dt":1556150400,"main":{"temp":11 - Pastebin.com not a html error code.

If you're going to persist in posting links, please at least make them clickable.
Better still, just post text here.

I don't know why they are not clickable but 2 of them are screenshots and the pastebin contains this:

{"cod":"200","message":0.0064,"cnt":3,"list":[{"dt":1556150400,"main":{"temp":11.89,"temp_min":10.31,"temp_max":11.89,"pressure":1017.43,"sea_level":1017.43,"grnd_level":978.56,"humidity":89,"temp_kf":1.58},"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10n"}],"clouds":{"all":52},"wind":{"speed":1.49,"deg":346.568},"rain":{"3h":0.124},"sys":{"pod":"n"},"dt_txt":"2019-04-25 00:00:00"},{"dt":1556161200,"main":{"temp":10.07,"temp_min":8.88,"temp_max":10.07,"pressure":1017.08,"sea_level":1017.08,"grnd_level":978.69,"humidity":87,"temp_kf":1.19},"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04n"}],"clouds":{"all":100},"wind":{"speed":1.4,"deg":300.386},"sys":{"pod":"n"},"dt_txt":"2019-04-25 03:00:00"},{"dt":1556172000,"main":{"temp":11.15,"temp_min":10.36,"temp_max":11.15,"pressure":1017,"sea_level":1017,"grnd_level":979.45,"humidity":79,"temp_kf":0.79},"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"clouds":{"all":87},"wind":{"speed":1.02,"deg":330.011},"sys":{"pod":"d"},"dt_txt":"2019-04-25 06:00:00"}],"city":{"id":3165524,"name":"Turin","coord":{"lat":45.0678,"lon":7.6825},"country":"IT","population":865263}}