Parse Json download size

I have the following as part of a sketch that gets API data from Open Weather.
This works fine if I download the 'daily' API string that is, on average, 4156 characters long.
If I try to download more data with the 'hourly' API then the download fails Serial.print("parseObject() failed);

My question is, how long a string can I download? Is there a limit set by this code or within the Json library?
I have tried changing the #define JSON_BUFF_DIMENSION 2500 value but still no joy.

#include <ArduinoJson.h>
#define JSON_BUFF_DIMENSION 2500
  text.reserve(JSON_BUFF_DIMENSION);


void parseJson(const char * jsonString) {
  DynamicJsonBuffer jsonBuffer;
  JsonObject& root = jsonBuffer.parseObject(jsonString);
  if (!root.success()) {
    Serial.println("parseObject() failed");
    return;
  }
void.loop(){
//display stuff
}

Don't post snippets (Snippets R Us!)

Are you using ArduinoJson 5 ?
the DynamicJsonBuffer is allocated on the heap, so can grow big (as long as you have memory).

Yes I am using ArduinoJson 5

'On the heap'?

as opposed to on the stack.

Might be time to update to ArduinoJson 6. The "Assistant" can write most of the code for you:

I don't have a problem extracting the data I require which is all the assistant helps with.
My problem is parsing a large amount of data

Can you show an example of the large JSON document you are having trouble parsing?

{"lat":52.4976,"lon":-2.1689,"timezone":"Europe/London","timezone_offset":0,"current":{"dt":1642961262,"sunrise":1642925007,"sunset":1642955830,"temp":2.99,"feels_like":2.99,"pressure":1035,"humidity":86,"dew_point":0.88,"uvi":0,"clouds":64,"visibility":10000,"wind_speed":0.45,"wind_deg":233,"wind_gust":0.89,"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}]},"hourly":[{"dt":1642960800,"temp":2.99,"feels_like":0.57,"pressure":1035,"humidity":86,"dew_point":0.88,"uvi":0,"clouds":64,"visibility":10000,"wind_speed":2.45,"wind_deg":186,"wind_gust":3.12,"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}],"pop":0},{"dt":1642964400,"temp":2.55,"feels_like":0.02,"pressure":1035,"humidity":88,"dew_point":0.77,"uvi":0,"clouds":59,"visibility":10000,"wind_speed":2.48,"wind_deg":186,"wind_gust":3.18,"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04n"}],"pop":0},{"dt":1642968000,"temp":2.01,"feels_like":-0.55,"pressure":1034,"humidity":90,"dew_point":0.54,"uvi":0,"clouds":50,"visibility":10000,"wind_speed":2.41,"wind_deg":187,"wind_gust":3.03,"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03n"}],"pop":0},{"dt":1642971600,"temp":1.39,"feels_like":-1.32,"pressure":1034,"humidity":92,"dew_point":0.23,"uvi":0,"clouds":39,"visibility":10000,"wind_speed":2.44,"wind_deg":185,"wind_gust":3.05,"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03n"}],"pop":0},{"dt":1642975200,"temp":0.69,"feels_like":-2.13,"pressure":1033,"humidity":94,"dew_point":-0.14,"uvi":0,"clouds":28,"visibility":10000,"wind_speed":2.43,"wind_deg":184,"wind_gust":2.96,"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03n"}],"pop":0},{"dt":1642978800,"temp":-0.05,"feels_like":-3.12,"pressure":1033,"humidity":96,"dew_point":-0.75,"uvi":0,"clouds":16,"visibility":10000,"wind_speed":2.54,"wind_deg":184,"wind_gust":3.25,"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02n"}],"pop":0},{"dt":1642982400,"temp":-0.23,"feels_like":-3.44,"pressure":1033,"humidity":97,"dew_point":-0.82,"uvi":0,"clouds":15,"visibility":10000,"wind_speed":2.64,"wind_deg":184,"wind_gust":3.98,"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02n"}],"pop":0},{"dt":1642986000,"temp":-0.38,"feels_like":-3.45,"pressure":1033,"humidity":97,"dew_point":-0.9,"uvi":0,"clouds":11,"visibility":10000,"wind_speed":2.48,"wind_deg":187,"wind_gust":3.78,"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02n"}],"pop":0},{"dt":1642989600,"temp":-0.42,"feels_like":-3.39,"pressure":1033,"humidity":97,"dew_point":-0.92,"uvi":0,"clouds":15,"visibility":10000,"wind_speed":2.38,"wind_deg":185,"wind_gust":3.35,"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02n"}],"pop":0},{"dt":1642993200,"temp":-0.47,"feels_like":-2.89,"pressure":1033,"humidity":97,"dew_point":-1,"uvi":0,"clouds":16,"visibility":10000,"wind_speed":1.91,"wind_deg":191,"wind_gust":1.91,"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02n"}],"pop":0},{"dt":1642996800,"temp":-0.47,"feels_like":-2.81,"pressure":1032,"humidity":97,"dew_point":-1.04,"uvi":0,"clouds":15,"visibility":10000,"wind_speed":1.85,"wind_deg":189,"wind_gust":1.8,"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02n"}],"pop":0},{"dt":1643000400,"temp":-0.47,"feels_like":-2.58,"pressure":1032,"humidity":97,"dew_point":-1.09,"uvi":0,"clouds":14,"visibility":10000,"wind_speed":1.69,"wind_deg":199,"wind_gust":1.66,"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02n"}],"pop":0},{"dt":1643004000,"temp":-0.44,"feels_like":-2.29,"pressure":1033,"humidity":96,"dew_point":-1.11,"uvi":0,"clouds":12,"visibility":10000,"wind_speed":1.52,"wind_deg":191,"wind_gust":1.53,"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02n"}],"pop":0},{"dt":1643007600,"temp":-0.43,"feels_like":-0.43,"pressure":1033,"humidity":96,"dew_point":-1.2,"uvi":0,"clouds":0,"visibility":10000,"wind_speed":0.99,"wind_deg":206,"wind_gust":1,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1643011200,"temp":-0.38,"feels_like":-0.38,"pressure":1033,"humidity":95,"dew_point":-1.21,"uvi":0,"clouds":0,"visibility":10000,"wind_speed":0.66,"wind_deg":237,"wind_gust":0.66,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1643014800,"temp":0.43,"feels_like":0.43,"pressure":1034,"humidity":94,"dew_point":-0.52,"uvi":0.17,"clouds":0,"visibility":10000,"wind_speed":0.38,"wind_deg":300,"wind_gust":0.44,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"pop":0},{"dt":1643018400,"temp":2.08,"feels_like":2.08,"pressure":1034,"humidity":87,"dew_point":-0.02,"uvi":0.38,"clouds":0,"visibility":10000,"wind_speed":0.44,"wind_deg":358,"wind_gust":0.54,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"pop":0},{"dt":1643022000,"temp":3.48,"feels_like":3.48,"pressure":1034,"humidity":81,"dew_point":0.27,"uvi":0.6,"clouds":0,"visibility":10000,"wind_speed":0.58,"wind_deg":354,"wind_gust":0.6,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"pop":0},{"dt":1643025600,"temp":4.6,"feels_like":4.6,"pressure":1034,"humidity":76,"dew_point":0.54,"uvi":0.71,"clouds":0,"visibility":10000,"wind_speed":0.38,"wind_deg":15,"wind_gust":0.48,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"pop":0},{"dt":1643029200,"temp":5.34,"feels_like":5.34,"pressure":1034,"humidity":73,"dew_point":0.77,"uvi":0.64,"clouds":0,"visibility":10000,"wind_speed":0.47,"wind_deg":84,"wind_gust":0.67,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"pop":0},{"dt":1643032800,"temp":5.64,"feels_like":5.64,"pressure":1033,"humidity":72,"dew_point":0.89,"uvi":0.44,"clouds":0,"visibility":10000,"wind_speed":0.43,"wind_deg":145,"wind_gust":0.58,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"pop":0},{"dt":1643036400,"temp":5.4,"feels_like":5.4,"pressure":1033,"humidity":76,"dew_point":1.39,"uvi":0.22,"clouds":0,"visibility":10000,"wind_speed":0.1,"wind_deg":193,"wind_gust":0.17,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"pop":0},{"dt":1643040000,"temp":3.55,"feels_like":3.55,"pressure":1033,"humidity":83,"dew_point":0.85,"uvi":0,"clouds":0,"visibility":10000,"wind_speed":0.06,"wind_deg":65,"wind_gust":0.12,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"pop":0},{"dt":1643043600,"temp":2.12,"feels_like":2.12,"pressure":1033,"humidity":85,"dew_point":-0.26,"uvi":0,"clouds":0,"visibility":10000,"wind_speed":0.1,"wind_deg":358,"wind_gust":0.1,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1643047200,"temp":1.66,"feels_like":1.66,"pressure":1034,"humidity":86,"dew_point":-0.51,"uvi":0,"clouds":0,"visibility":10000,"wind_speed":0.49,"wind_deg":1,"wind_gust":0.46,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1643050800,"temp":1.39,"feels_like":1.39,"pressure":1034,"humidity":87,"dew_point":-0.69,"uvi":0,"clouds":0,"visibility":10000,"wind_speed":0.2,"wind_deg":49,"wind_gust":0.28,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1643054400,"temp":1.22,"feels_like":1.22,"pressure":1034,"humidity":87,"dew_point":-0.77,"uvi":0,"clouds":0,"visibility":10000,"wind_speed":0.72,"wind_deg":116,"wind_gust":0.71,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1643058000,"temp":1.08,"feels_like":1.08,"pressure":1035,"humidity":88,"dew_point":-0.85,"uvi":0,"clouds":0,"visibility":10000,"wind_speed":0.79,"wind_deg":129,"wind_gust":0.86,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1643061600,"temp":0.93,"feels_like":0.93,"pressure":1035,"humidity":88,"dew_point":-0.92,"uvi":0,"clouds":0,"visibility":10000,"wind_speed":0.51,"wind_deg":148,"wind_gust":0.56,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1643065200,"temp":0.75,"feels_like":0.75,"pressure":1035,"humidity":89,"dew_point":-1,"uvi":0,"clouds":0,"visibility":10000,"wind_speed":0.41,"wind_deg":199,"wind_gust":0.47,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1643068800,"temp":0.58,"feels_like":0.58,"pressure":1035,"humidity":90,"dew_point":-1.07,"uvi":0,"clouds":0,"visibility":10000,"wind_speed":0.35,"wind_deg":168,"wind_gust":0.37,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1643072400,"temp":0.49,"feels_like":0.49,"pressure":1035,"humidity":90,"dew_point":-1.09,"uvi":0,"clouds":0,"visibility":10000,"wind_speed":0.69,"wind_deg":144,"wind_gust":0.71,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1643076000,"temp":0.41,"feels_like":0.41,"pressure":1035,"humidity":91,"dew_point":-1.11,"uvi":0,"clouds":0,"visibility":10000,"wind_speed":0.79,"wind_deg":166,"wind_gust":0.76,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1643079600,"temp":0.28,"feels_like":0.28,"pressure":1035,"humidity":91,"dew_point":-1.17,"uvi":0,"clouds":0,"visibility":10000,"wind_speed":0.76,"wind_deg":212,"wind_gust":0.73,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1643083200,"temp":0.16,"feels_like":0.16,"pressure":1035,"humidity":91,"dew_point":-1.25,"uvi":0,"clouds":0,"visibility":10000,"wind_speed":0.62,"wind_deg":228,"wind_gust":0.64,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1643086800,"temp":0.11,"feels_like":0.11,"pressure":1034,"humidity":91,"dew_point":-1.29,"uvi":0,"clouds":0,"visibility":10000,"wind_speed":0.82,"wind_deg":172,"wind_gust":0.81,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1643090400,"temp":0.06,"feels_like":0.06,"pressure":1034,"humidity":92,"dew_point":-1.29,"uvi":0,"clouds":0,"visibility":10000,"wind_speed":1.22,"wind_deg":189,"wind_gust":1.2,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1643094000,"temp":-0.04,"feels_like":-0.04,"pressure":1034,"humidity":92,"dew_point":-1.39,"uvi":0,"clouds":0,"visibility":10000,"wind_speed":1.16,"wind_deg":200,"wind_gust":1.14,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1643097600,"temp":-0.08,"feels_like":-0.08,"pressure":1035,"humidity":91,"dew_point":-1.46,"uvi":0,"clouds":0,"visibility":10000,"wind_speed":1.17,"wind_deg":208,"wind_gust":1.17,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0},{"dt":1643101200,"temp":0.69,"feels_like":0.69,"pressure":1035,"humidity":89,"dew_point":-0.99,"uvi":0.17,"clouds":0,"visibility":10000,"wind_speed":1.17,"wind_deg":227,"wind_gust":1.13,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"pop":0},{"dt":1643104800,"temp":2.34,"feels_like":2.34,"pressure":1035,"humidity":82,"dew_point":-0.59,"uvi":0.38,"clouds":0,"visibility":10000,"wind_speed":0.88,"wind_deg":237,"wind_gust":1.27,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"pop":0},{"dt":1643108400,"temp":3.77,"feels_like":3.77,"pressure":1035,"humidity":76,"dew_point":-0.27,"uvi":0.6,"clouds":0,"visibility":10000,"wind_speed":1.06,"wind_deg":268,"wind_gust":1.48,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"pop":0},{"dt":1643112000,"temp":4.88,"feels_like":3.86,"pressure":1035,"humidity":71,"dew_point":-0.02,"uvi":0.71,"clouds":0,"visibility":10000,"wind_speed":1.46,"wind_deg":290,"wind_gust":1.94,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"pop":0},{"dt":1643115600,"temp":5.6,"feels_like":4.52,"pressure":1034,"humidity":68,"dew_point":0.1,"uvi":0.67,"clouds":0,"visibility":10000,"wind_speed":1.59,"wind_deg":298,"wind_gust":2.1,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"pop":0},{"dt":1643119200,"temp":5.9,"feels_like":4.56,"pressure":1034,"humidity":67,"dew_point":0.19,"uvi":0.46,"clouds":0,"visibility":10000,"wind_speed":1.86,"wind_deg":299,"wind_gust":2.64,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"pop":0},{"dt":1643122800,"temp":5.49,"feels_like":3.99,"pressure":1034,"humidity":72,"dew_point":0.75,"uvi":0.22,"clouds":0,"visibility":10000,"wind_speed":1.95,"wind_deg":307,"wind_gust":3.18,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"pop":0},{"dt":1643126400,"temp":3.66,"feels_like":1.79,"pressure":1034,"humidity":80,"dew_point":0.43,"uvi":0,"clouds":0,"visibility":10000,"wind_speed":2.02,"wind_deg":316,"wind_gust":2.25,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"pop":0},{"dt":1643130000,"temp":2.09,"feels_like":0.08,"pressure":1034,"humidity":86,"dew_point":-0.07,"uvi":0,"clouds":0,"visibility":10000,"wind_speed":1.91,"wind_deg":321,"wind_gust":2.13,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01n"}],"pop":0}],"daily":[{"dt":1642939200,"sunrise":1642925007,"sunset":1642955830,"moonrise":1642979040,"moonset":1642933980,"moon_phase":0.68,"temp":{"day":4.39,"min":-0.05,"max":4.86,"night":-0.05,"eve":2.99,"morn":0.88},"feels_like":{"day":1.43,"night":-3.12,"eve":0.57,"morn":-1.1},"pressure":1035,"humidity":82,"dew_point":1.56,"wind_speed":3.75,"wind_deg":194,"wind_gust":4.75,"weather":[{"id":802,"main":"Clouds","description":"scattered clouds","icon":"03d"}],"clouds":25,"pop":0,"uvi":0.72},{"dt":1643025600,"sunrise":1643011331,"sunset":1643042338,"moonrise":0,"moonset":1643021160,"moon_phase":0.71,"temp":{"day":4.6,"min":-0.47,"max":5.64,"night":0.75,"eve":1.66,"morn":-0.44},"feels_like":{"day":4.6,"night":0.75,"eve":1.66,"morn":-2.29},"pressure":1034,"humidity":76,"dew_point":0.54,"wind_speed":2.64,"wind_deg":184,"wind_gust":3.98,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":0,"pop":0,"uvi":0.71},{"dt":1643112000,"sunrise":1643097652,"sunset":1643128846,"moonrise":1643070180,"moonset":1643108460,"moon_phase":0.75,"temp":{"day":4.88,"min":-0.08,"max":5.9,"night":1.2,"eve":1.65,"morn":0.06},"feels_like":{"day":3.86,"night":-0.51,"eve":-0.13,"morn":0.06},"pressure":1035,"humidity":71,"dew_point":-0.02,"wind_speed":2.02,"wind_deg":316,"wind_gust":3.18,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":0,"pop":0,"uvi":0.71},{"dt":1643198400,"sunrise":1643183971,"sunset":1643215356,"moonrise":1643161620,"moonset":1643195940,"moon_phase":0.78,"temp":{"day":5.99,"min":0.6,"max":6.67,"night":2,"eve":2.98,"morn":0.6},"feels_like":{"day":4.25,"night":-1.35,"eve":0.51,"morn":-1.7},"pressure":1035,"humidity":76,"dew_point":2.01,"wind_speed":3.32,"wind_deg":211,"wind_gust":7.07,"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02d"}],"clouds":13,"pop":0,"uvi":0.76},{"dt":1643284800,"sunrise":1643270287,"sunset":1643301866,"moonrise":1643253240,"moonset":1643283720,"moon_phase":0.82,"temp":{"day":8.7,"min":1.98,"max":8.7,"night":4.69,"eve":4.2,"morn":5.38},"feels_like":{"day":5.63,"night":0.73,"eve":1.35,"morn":1.53},"pressure":1027,"humidity":91,"dew_point":7.24,"wind_speed":7.39,"wind_deg":315,"wind_gust":14.74,"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":100,"pop":0.2,"rain":0.12,"uvi":0.31},{"dt":1643371200,"sunrise":1643356601,"sunset":1643388377,"moonrise":1643344920,"moonset":1643372100,"moon_phase":0.86,"temp":{"day":6.55,"min":2.85,"max":7.48,"night":3.19,"eve":3.66,"morn":3},"feels_like":{"day":3.63,"night":0.69,"eve":1.87,"morn":-0.66},"pressure":1038,"humidity":79,"dew_point":2.98,"wind_speed":5.66,"wind_deg":309,"wind_gust":13.19,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"clouds":100,"pop":0,"uvi":0.85},{"dt":1643457600,"sunrise":1643442913,"sunset":1643474889,"moonrise":1643436240,"moonset":1643461440,"moon_phase":0.9,"temp":{"day":9.58,"min":1.2,"max":10.6,"night":7.35,"eve":8.87,"morn":2.28},"feels_like":{"day":6.58,"night":3.96,"eve":5.8,"morn":-1.05},"pressure":1032,"humidity":77,"dew_point":5.7,"wind_speed":7.18,"wind_deg":277,"wind_gust":13.99,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"clouds":91,"pop":0,"uvi":1},{"dt":1643544000,"sunrise":1643529223,"sunset":1643561401,"moonrise":1643526780,"moonset":1643551800,"moon_phase":0.93,"temp":{"day":6.54,"min":4.74,"max":7.2,"night":4.96,"eve":5.64,"morn":6.26},"feels_like":{"day":3.24,"night":0.67,"eve":1.49,"morn":2.57},"pressure":1034,"humidity":70,"dew_point":1.32,"wind_speed":6.58,"wind_deg":298,"wind_gust":13.78,"weather":[{"id":500,"main":"Rain","description":"light rain","icon":"10d"}],"clouds":100,"pop":0.2,"rain":0.14,"uvi":1}]}

This one works

{"lat":52.4976,"lon":-2.1689,"timezone":"Europe/London","timezone_offset":0,"current":{"dt":1642961465,"sunrise":1642925007,"sunset":1642955830,"temp":2.99,"feels_like":0.24,"pressure":1035,"humidity":86,"dew_point":0.88,"uvi":0,"clouds":96,"visibility":10000,"wind_speed":2.82,"wind_deg":193,"wind_gust":4.69,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04n"}]},"daily":[{"dt":1642939200,"sunrise":1642925007,"sunset":1642955830,"moonrise":1642979040,"moonset":1642933980,"moon_phase":0.68,"temp":{"day":4.15,"min":0.52,"max":4.15,"night":0.52,"eve":2.99,"morn":0.88},"feels_like":{"day":1.06,"night":-2.58,"eve":0.24,"morn":-1.1},"pressure":1035,"humidity":84,"dew_point":1.55,"wind_speed":3.8,"wind_deg":197,"wind_gust":4.86,"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"clouds":68,"pop":0,"uvi":0.72},{"dt":1643025600,"sunrise":1643011331,"sunset":1643042338,"moonrise":0,"moonset":1643021160,"moon_phase":0.71,"temp":{"day":4.49,"min":-0.04,"max":5.47,"night":0.65,"eve":1.6,"morn":0.13},"feels_like":{"day":4.49,"night":0.65,"eve":1.6,"morn":-1.39},"pressure":1034,"humidity":78,"dew_point":0.8,"wind_speed":2.74,"wind_deg":187,"wind_gust":4.95,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":0,"pop":0,"uvi":0.71},{"dt":1643112000,"sunrise":1643097652,"sunset":1643128846,"moonrise":1643070180,"moonset":1643108460,"moon_phase":0.75,"temp":{"day":4.72,"min":-0.24,"max":5.81,"night":0.93,"eve":1.38,"morn":-0.08},"feels_like":{"day":4.72,"night":-1.53,"eve":-0.73,"morn":-0.08},"pressure":1034,"humidity":74,"dew_point":0.33,"wind_speed":2.13,"wind_deg":294,"wind_gust":2.86,"weather":[{"id":800,"main":"Clear","description":"clear sky","icon":"01d"}],"clouds":0,"pop":0,"uvi":0.71},{"dt":1643198400,"sunrise":1643183971,"sunset":1643215356,"moonrise":1643161620,"moonset":1643195940,"moon_phase":0.78,"temp":{"day":5.85,"min":0.33,"max":6.51,"night":2.46,"eve":3,"morn":0.36},"feels_like":{"day":4.7,"night":-1.19,"eve":0.08,"morn":-1.18},"pressure":1034,"humidity":72,"dew_point":1.07,"wind_speed":3.89,"wind_deg":222,"wind_gust":9.3,"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"clouds":63,"pop":0,"uvi":0.76},{"dt":1643284800,"sunrise":1643270287,"sunset":1643301866,"moonrise":1643253240,"moonset":1643283720,"moon_phase":0.82,"temp":{"day":8.65,"min":2.69,"max":8.65,"night":3.06,"eve":5.28,"morn":5.92},"feels_like":{"day":5.66,"night":-0.12,"eve":1.93,"morn":2.12},"pressure":1027,"humidity":91,"dew_point":7.06,"wind_speed":5.85,"wind_deg":249,"wind_gust":14.05,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"clouds":99,"pop":0.19,"uvi":0.31},{"dt":1643371200,"sunrise":1643356601,"sunset":1643388377,"moonrise":1643344920,"moonset":1643372100,"moon_phase":0.86,"temp":{"day":7.03,"min":2.61,"max":7.89,"night":3.04,"eve":4.12,"morn":3.03},"feels_like":{"day":5.01,"night":-0.09,"eve":1.87,"morn":-0.21},"pressure":1038,"humidity":72,"dew_point":2.23,"wind_speed":5.25,"wind_deg":313,"wind_gust":13.18,"weather":[{"id":803,"main":"Clouds","description":"broken clouds","icon":"04d"}],"clouds":66,"pop":0,"uvi":0.85},{"dt":1643457600,"sunrise":1643442913,"sunset":1643474889,"moonrise":1643436240,"moonset":1643461440,"moon_phase":0.9,"temp":{"day":12.31,"min":3.74,"max":12.31,"night":6.56,"eve":9.66,"morn":8.09},"feels_like":{"day":11.42,"night":3.64,"eve":7.54,"morn":5.08},"pressure":1032,"humidity":70,"dew_point":6.83,"wind_speed":6.74,"wind_deg":266,"wind_gust":13.52,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"clouds":87,"pop":0,"uvi":1},{"dt":1643544000,"sunrise":1643529223,"sunset":1643561401,"moonrise":1643526780,"moonset":1643551800,"moon_phase":0.93,"temp":{"day":7.3,"min":4.38,"max":7.3,"night":4.38,"eve":5.8,"morn":6.38},"feels_like":{"day":4.14,"night":0.69,"eve":2.31,"morn":3.02},"pressure":1036,"humidity":65,"dew_point":1.05,"wind_speed":5.68,"wind_deg":312,"wind_gust":12.02,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}],"clouds":100,"pop":0,"uvi":1}]}

The one that works has a minimum size of 5258 (Recommended: 6144). The one that doesn't work has a minimum size of 21674 (Recommended: 24576).

Could it be that you are running out of memory on the larger one?

Is there a way I could test this?

If you use ArduinoJson 6 the deserializeJson() function will return a DeserializationError object that will tell you WHY the deserialization failed.

DynamicJsonDocument doc(6144);

DeserializationError error = deserializeJson(doc, input);

if (error) {
  Serial.print(F("deserializeJson() failed: "));
  Serial.println(error.f_str());
  return;
}

I did try this but it would not compile. It said something along the lines of deserializeJson() is not part of ArduinoJson 6

I would guess something along the lines of a library installation error.

This is what I get when I try to compile:
no matching function for call to 'deserializeJson(ArduinoJson6191_F1::DynamicJsonDocument&)'

It looks like nothing is being passed to the parser. You need to pass it the JSON document in some way. You can pass a String, character pointer, const character pointer, or a Stream (serial port, network client, or file) to read the data from.

I have updated ArduinoJson.h to v6 and downloaded the example parse sketch as shown below.
Each time I press reset it Serial.print's the required information.

I have added the first section of the weather API as a test (Line 14) but if I un-comment this line the first two words, 'Lat' and 'Lon' are highlighted in orange and I get the error 'inconsistent user-defined literal suffixes 'lat' and 'lon' in string literal'

[code]

#include <ArduinoJson.h>

void setup() {

  Serial.begin(9600);
  while (!Serial) continue;

  DynamicJsonDocument doc(200);

  char json[] =
 "{\"sensor\":\"gps\",\"time\":1351824120,\"data\":[48.756080,2.302038]}";

//"{"lat":52.4976,"lon":-2.1689,"timezone":"Europe/London","timezone_offset":0,"current":}";

  DeserializationError error = deserializeJson(doc, json);

  if (error) {
    Serial.print(F("deserializeJson() failed: "));
    Serial.println(error.f_str());
    return;
  }


  const char* sensor = doc["sensor"];
  long time = doc["time"];
  double latitude = doc["data"][0];
  double longitude = doc["data"][1];

  Serial.println(sensor);
  Serial.println(time);
  Serial.println(latitude, 6);
  Serial.println(longitude, 6);
}

void loop() {

}

[/code]

if you inject in the char array the json file you shared earlier, as it contains double quotes, you mess up with the C++ string definition. You either need to escape those double quotes (write them as ") or go for a string literal

As it's a downloaded file I cannot edit in any way.

How would I do this?

you don't need to do that when you download, but if you want to inject that into your code for testing (as static text) then you need to.

an example with a string literal:

create a project with those 2 files.

test.ino

#include <ArduinoJson.h>
#include "json.h"

StaticJsonDocument<200> filter;
StaticJsonDocument<300> doc;

void setup() {

  Serial.begin(115200);

  filter["lat"] = true;
  filter["lon"] = true;
  filter["daily"][0]["sunrise"] = true;
  filter["daily"][0]["sunset"] = true;
  deserializeJson(doc, (const __FlashStringHelper*) sampleJSON, DeserializationOption::Filter(filter));
  serializeJsonPretty(doc, Serial);
}

void loop() {}

I store the JSON data separately in this file

json.h

// C++ raw string literals cf http://en.cppreference.com/w/cpp/language/string_literal
// USE PROGMEM with Program Space Utilities http://www.nongnu.org/avr-libc/user-manual/group__avr__pgmspace.html

const char sampleJSON[] PROGMEM = R"--8<--8<--({
  "lat":52.4976,
  "lon":-2.1689,
  "timezone":"Europe/London",
  "timezone_offset":0,
  "current":{
    "dt":1642961465,
    "sunrise":1642925007,
    "sunset":1642955830,
    "temp":2.99,
    "feels_like":0.24,
    "pressure":1035,
    "humidity":86,
    "dew_point":0.88,
    "uvi":0,
    "clouds":96,
    "visibility":10000,
    "wind_speed":2.82,
    "wind_deg":193,
    "wind_gust":4.69,
    "weather":[
      {
        "id":804,
        "main":"Clouds",
        "description":"overcast clouds",
        "icon":"04n"
      }
    ]
  },
  "daily":[
    {
      "dt":1642939200,
      "sunrise":1642925007,
      "sunset":1642955830,
      "moonrise":1642979040,
      "moonset":1642933980,
      "moon_phase":0.68,
      "temp":{
        "day":4.15,
        "min":0.52,
        "max":4.15,
        "night":0.52,
        "eve":2.99,
        "morn":0.88
      },
      "feels_like":{
        "day":1.06,
        "night":-2.58,
        "eve":0.24,
        "morn":-1.1
      },
      "pressure":1035,
      "humidity":84,
      "dew_point":1.55,
      "wind_speed":3.8,
      "wind_deg":197,
      "wind_gust":4.86,
      "weather":[
        {
          "id":803,
          "main":"Clouds",
          "description":"broken clouds",
          "icon":"04d"
        }
      ],
      "clouds":68,
      "pop":0,
      "uvi":0.72
    },
    {
      "dt":1643025600,
      "sunrise":1643011331,
      "sunset":1643042338,
      "moonrise":0,
      "moonset":1643021160,
      "moon_phase":0.71,
      "temp":{
        "day":4.49,
        "min":-0.04,
        "max":5.47,
        "night":0.65,
        "eve":1.6,
        "morn":0.13
      },
      "feels_like":{
        "day":4.49,
        "night":0.65,
        "eve":1.6,
        "morn":-1.39
      },
      "pressure":1034,
      "humidity":78,
      "dew_point":0.8,
      "wind_speed":2.74,
      "wind_deg":187,
      "wind_gust":4.95,
      "weather":[
        {
          "id":800,
          "main":"Clear",
          "description":"clear sky",
          "icon":"01d"
        }
      ],
      "clouds":0,
      "pop":0,
      "uvi":0.71
    },
    {
      "dt":1643112000,
      "sunrise":1643097652,
      "sunset":1643128846,
      "moonrise":1643070180,
      "moonset":1643108460,
      "moon_phase":0.75,
      "temp":{
        "day":4.72,
        "min":-0.24,
        "max":5.81,
        "night":0.93,
        "eve":1.38,
        "morn":-0.08
      },
      "feels_like":{
        "day":4.72,
        "night":-1.53,
        "eve":-0.73,
        "morn":-0.08
      },
      "pressure":1034,
      "humidity":74,
      "dew_point":0.33,
      "wind_speed":2.13,
      "wind_deg":294,
      "wind_gust":2.86,
      "weather":[
        {
          "id":800,
          "main":"Clear",
          "description":"clear sky",
          "icon":"01d"
        }
      ],
      "clouds":0,
      "pop":0,
      "uvi":0.71
    },
    {
      "dt":1643198400,
      "sunrise":1643183971,
      "sunset":1643215356,
      "moonrise":1643161620,
      "moonset":1643195940,
      "moon_phase":0.78,
      "temp":{
        "day":5.85,
        "min":0.33,
        "max":6.51,
        "night":2.46,
        "eve":3,
        "morn":0.36
      },
      "feels_like":{
        "day":4.7,
        "night":-1.19,
        "eve":0.08,
        "morn":-1.18
      },
      "pressure":1034,
      "humidity":72,
      "dew_point":1.07,
      "wind_speed":3.89,
      "wind_deg":222,
      "wind_gust":9.3,
      "weather":[
        {
          "id":803,
          "main":"Clouds",
          "description":"broken clouds",
          "icon":"04d"
        }
      ],
      "clouds":63,
      "pop":0,
      "uvi":0.76
    },
    {
      "dt":1643284800,
      "sunrise":1643270287,
      "sunset":1643301866,
      "moonrise":1643253240,
      "moonset":1643283720,
      "moon_phase":0.82,
      "temp":{
        "day":8.65,
        "min":2.69,
        "max":8.65,
        "night":3.06,
        "eve":5.28,
        "morn":5.92
      },
      "feels_like":{
        "day":5.66,
        "night":-0.12,
        "eve":1.93,
        "morn":2.12
      },
      "pressure":1027,
      "humidity":91,
      "dew_point":7.06,
      "wind_speed":5.85,
      "wind_deg":249,
      "wind_gust":14.05,
      "weather":[
        {
          "id":804,
          "main":"Clouds",
          "description":"overcast clouds",
          "icon":"04d"
        }
      ],
      "clouds":99,
      "pop":0.19,
      "uvi":0.31
    },
    {
      "dt":1643371200,
      "sunrise":1643356601,
      "sunset":1643388377,
      "moonrise":1643344920,
      "moonset":1643372100,
      "moon_phase":0.86,
      "temp":{
        "day":7.03,
        "min":2.61,
        "max":7.89,
        "night":3.04,
        "eve":4.12,
        "morn":3.03
      },
      "feels_like":{
        "day":5.01,
        "night":-0.09,
        "eve":1.87,
        "morn":-0.21
      },
      "pressure":1038,
      "humidity":72,
      "dew_point":2.23,
      "wind_speed":5.25,
      "wind_deg":313,
      "wind_gust":13.18,
      "weather":[
        {
          "id":803,
          "main":"Clouds",
          "description":"broken clouds",
          "icon":"04d"
        }
      ],
      "clouds":66,
      "pop":0,
      "uvi":0.85
    },
    {
      "dt":1643457600,
      "sunrise":1643442913,
      "sunset":1643474889,
      "moonrise":1643436240,
      "moonset":1643461440,
      "moon_phase":0.9,
      "temp":{
        "day":12.31,
        "min":3.74,
        "max":12.31,
        "night":6.56,
        "eve":9.66,
        "morn":8.09
      },
      "feels_like":{
        "day":11.42,
        "night":3.64,
        "eve":7.54,
        "morn":5.08
      },
      "pressure":1032,
      "humidity":70,
      "dew_point":6.83,
      "wind_speed":6.74,
      "wind_deg":266,
      "wind_gust":13.52,
      "weather":[
        {
          "id":804,
          "main":"Clouds",
          "description":"overcast clouds",
          "icon":"04d"
        }
      ],
      "clouds":87,
      "pop":0,
      "uvi":1
    },
    {
      "dt":1643544000,
      "sunrise":1643529223,
      "sunset":1643561401,
      "moonrise":1643526780,
      "moonset":1643551800,
      "moon_phase":0.93,
      "temp":{
        "day":7.3,
        "min":4.38,
        "max":7.3,
        "night":4.38,
        "eve":5.8,
        "morn":6.38
      },
      "feels_like":{
        "day":4.14,
        "night":0.69,
        "eve":2.31,
        "morn":3.02
      },
      "pressure":1036,
      "humidity":65,
      "dew_point":1.05,
      "wind_speed":5.68,
      "wind_deg":312,
      "wind_gust":12.02,
      "weather":[
        {
          "id":804,
          "main":"Clouds",
          "description":"overcast clouds",
          "icon":"04d"
        }
      ],
      "clouds":100,
      "pop":0,
      "uvi":1
    }
  ]
})--8<--8<--";

if all goes well, Serial Monitor (@ 115200 bauds) will show

{
  "lat": 52.4976,
  "lon": -2.1689,
  "daily": [
    {
      "sunrise": 1642925007,
      "sunset": 1642955830
    },
    {
      "sunrise": 1643011331,
      "sunset": 1643042338
    },
    {
      "sunrise": 1643097652,
      "sunset": 1643128846
    },
    {
      "sunrise": 1643183971,
      "sunset": 1643215356
    },
    {
      "sunrise": 1643270287,
      "sunset": 1643301866
    },
    {
      "sunrise": 1643356601,
      "sunset": 1643388377
    }
  ]
}

==> that example shows how you can put filters to work for you when you have tons of data