API Esp8266 problems

Hi, I have another question…

I have been trying to study this code to know what it does exactly but I cannot find specific information about the operation of this code or the libraries.

Code:

#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <ArduinoJson.h>

const char* ssid = "Internet";
const char* password = "Password";

void setup() 
{
  Serial.begin(115200);
  WiFi.begin(ssid, password);

  while (WiFi.status() != WL_CONNECTED) 
  {
    delay(1000);
    Serial.println("Connecting...");
  }
}

void loop() 
{
  if (WiFi.status() == WL_CONNECTED) 
  {
    HTTPClient http; //Object of class HTTPClient
    http.begin("http://jsonplaceholder.typicode.com/users/1");
    int httpCode = http.GET();

    if (httpCode > 0) 
    {
      const size_t bufferSize = JSON_OBJECT_SIZE(2) + JSON_OBJECT_SIZE(3) + JSON_OBJECT_SIZE(5) + JSON_OBJECT_SIZE(8) + 370;
      DynamicJsonBuffer jsonBuffer(bufferSize);
      JsonObject& root = jsonBuffer.parseObject(http.getString());
 
      int id = root["id"]; 
      const char* name = root["name"];
      const char* username = root["username"]; 
      const char* email = root["email"]; 

      Serial.print("Name:");
      Serial.println(name);
      Serial.print("Username:");
      Serial.println(username);
      Serial.print("Email:");
      Serial.println(email);
    }
    http.end(); //Close connection
  }
  delay(60000);

Serial Print:

Connecting...
Connecting...
Connecting...
Connecting...
Name:Leanne Graham
Username:Bret
Email:Sincere@april.biz

I would like to know what each part does, especially this:
const size_t bufferSize = JSON_OBJECT_SIZE(2) + JSON_OBJECT_SIZE(3) + JSON_OBJECT_SIZE(5) + JSON_OBJECT_SIZE( 8 ) + 370;
DynamicJsonBuffer jsonBuffer(bufferSize);
JsonObject& root = jsonBuffer.parseObject(http.getString());

I need to know this information because I want to put an API from wikipedia, but I think the problem is that it is too heavy to store in RAM, so I would be saving it in parts in an SD

API I want to use: https://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&format=json&titles=car

Its possible?

buffersize reserves enough buffer for your json you expect.

See the documentation of ArduinoJson about what's needed.
There is even an Assistant to generate these lines of code:

If you put in your JSON you will get something like

const size_t capacity = 2*JSON_ARRAY_SIZE(1) + 3*JSON_OBJECT_SIZE(1) + 3*JSON_OBJECT_SIZE(2) + 2*JSON_OBJECT_SIZE(3) + JSON_OBJECT_SIZE(4) + 78700;
DynamicJsonDocument doc(capacity);