1st method. Like this below. In the JSON object jsonUser data is stored
... ... ...
var
ANode: TJSONObject;
... ... ...
begin
... ... ...
if Instagram.ParseGetAccount(AccountUsername) then
begin
... ... ...
for i:=0 to Instagram.Images.Count-1 do
begin
ANode:= TJSONObject(Instagram.Images.Objects[i]);
ِAShortCode:= ANode.Strings['shortcode'];
ALikes:=ANode.Objects['edge_media_preview_like'].Integers['count'];
ACommentCount:=ANode.Objects['edge_media_to_comment'].Integers['count'];
// You can parse any other media post properties from Instagram JSON Object from media JSON node
... ... ...
end;
for i:=0 to Instagram.Videos.Count-1 do
begin
ANode:= TJSONObject(Instagram.Videos.Objects[i]);
ِAShortCode:= ANode.Strings['shortcode'];
ALikes:=ANode.Objects['edge_media_preview_like'].Integers['count'];
ACommentCount:=ANode.Objects['edge_media_to_comment'].Integers['count'];
// You can parse any other media post properties from Instagram JSON Object from media JSON node
... ... ...
end;
end;
... ... ...
end;
You can also work directly with the received
jsonUser object, which contains an array of the last 12 media
ANode:=Instagram.jsonUser.Objects['edge_owner_to_timeline_media'].arrays['edges'].Objects[i].Objects['node']
The advantage of the 1st method:
+ no authorization is required,
+ less likely to be banned.
Drawback:
-only a maximum of 12 latest media return