Rosetta Code/Rank languages by popularity

You are encouraged to solve this task according to the task description, using any language you may know.
Task

Sort the most popular computer programming languages based in number of members in Rosetta Code categories.

Sample output on 01 juin 2022 at 14:13 +02

Rank:  1 (1,540 entries) Phix
Rank:  2 (1,531 entries) Wren
Rank:  3 (1,507 entries) Julia
Rank:  4 (1,494 entries) Go
Rank:  5 (1,488 entries) Raku
Rank:  6 (1,448 entries) Perl
Rank:  7 (1,402 entries) Nim
Rank:  8 (1,382 entries) Python
Rank:  9 (1,204 entries) C
Rank: 10 (1,152 entries) REXX
...


Notes
 
   Each language typically demonstrates one or two methods of accessing the data: 
   with web scraping   (via http://www.rosettacode.org/mw/index.php?title=Special:Categories&limit=5000)
   with the API method   (examples below for Awk, Perl, Ruby, Tcl, etc). 
   The scraping and API solutions can be separate subsections, see the Tcl example.
   Filtering wrong results is optional.   You can check against Special:MostLinkedCategories (if using web scraping)
If you use the API, and do elect to filter, you may check your results against this complete, accurate, sortable, wikitable listing of all 869 programming languages, updated periodically, typically weekly.
   A complete ranked listing of all   813   languages (from the REXX example) is included here   ──►   output from the REXX program.


Procedure handleError(value, msg.s)
  If value = 0
    MessageRequester("Error", msg)
    End
  EndIf
EndProcedure
 
Structure languageInfo
  name.s
  pageCount.i
EndStructure
 
#JSON_web_data = 0 ;ID# for our parsed JSON web data object
 
Define NewList languages.languageInfo()
 
Define blah.s, object_val, allPages_mem, title_mem, page_mem, categoryInfo_mem, continue_mem
Define url$, title$, currentPage$, language$, langPageCount, gcmcontinue$, *bufferPtr
 
handleError(InitNetwork(), "Unable to initialize network functions.")
 
Repeat
  url$ = "http://www.rosettacode.org/mw/api.php?action=query" +
         "&generator=categorymembers&gcmtitle=Category:Programming%20Languages" +
         "&gcmlimit=500" + "&gcmcontinue=" + gcmcontinue$ +
         "&prop=categoryinfo&format=json"
 
  *bufferPtr = ReceiveHTTPMemory(url$)
  handleError(*bufferPtr, "Unable to receive web page data.")
  If CatchJSON(#JSON_web_data, *bufferPtr, MemorySize(*bufferPtr)) = 0
    MessageRequester("Error", JSONErrorMessage() + " at position " +
                              JSONErrorPosition() + " in line " +
                              JSONErrorLine() + " of JSON web Data")
    End
  EndIf
  FreeMemory(*bufferPtr)
 
  object_val = JSONValue(#JSON_web_data)
  allPages_mem = GetJSONMember(GetJSONMember(object_val, "query"), "pages")
  If ExamineJSONMembers(allPages_mem)
    While NextJSONMember(allPages_mem)
      page_mem = JSONMemberValue(allPages_mem)
      title_mem = GetJSONMember(page_mem, "title")
      If title_mem
        title$ = GetJSONString(title_mem)
        If Left(title$, 9) = "Category:"
          language$ = Mid(title$, 10)
          categoryInfo_mem = GetJSONMember(page_mem, "categoryinfo")
          If categoryInfo_mem
            langPageCount = GetJSONInteger(GetJSONMember(categoryInfo_mem, "pages"))
          Else
            langPageCount = 0
          EndIf
 
          AddElement(languages())
          languages()\name = language$
          languages()\pageCount = langPageCount
        EndIf
      EndIf
    Wend
  EndIf
 
  ;check for continue
  continue_mem = GetJSONMember(object_val, "continue")
  If continue_mem
    gcmcontinue$ = GetJSONString(GetJSONMember(continue_mem, "gcmcontinue"))
  Else
    gcmcontinue$ = ""
  EndIf
 
  FreeJSON(#JSON_web_data)
Until gcmcontinue$ = ""
 
;all data has been aquired, now process and display it
SortStructuredList(languages(), #PB_Sort_Descending, OffsetOf(languageInfo\pageCount), #PB_Integer)
 
If OpenConsole()
 
  If ListSize(languages())
    Define i, *startOfGroupPtr.languageInfo, *lastElementPtr, groupSize, rank
    Define outputSize = 100, outputLine
 
    PrintN(Str(ListSize(languages())) + " languages." + #CRLF$)
    LastElement(languages())
    *lastElementPtr = @languages() ;pointer to last element
    FirstElement(languages())
    *startOfGroupPtr = @languages() ;pointer to first element
    groupSize = 1
    rank = 1
 
    While NextElement(languages())
      If languages()\pageCount <> *startOfGroupPtr\pageCount Or *lastElementPtr = @languages()
        ;display a group of languages at the same rank
        ChangeCurrentElement(languages(), *startOfGroupPtr)
        For i = 1 To groupSize
          ;display output in groups to allow viewing of all entries
          If outputLine = 0
            PrintN(" Rank   Tasks  Language")
            PrintN(" ------ -----  --------")
          EndIf
 
          PrintN(RSet(Str(rank), 6) + ".  " +
                 RSet(Str(languages()\pageCount), 4) + "  " +
                 languages()\name)
 
          outputLine + 1
          If outputLine >= outputSize
            Print(#CRLF$ + #CRLF$ + "Press ENTER to continue" + #CRLF$): Input()
            outputLine = 0
          EndIf
 
          NextElement(languages())
        Next
 
        rank + groupSize
        groupSize = 1
        *startOfGroupPtr = @languages()
      Else
        groupSize + 1
      EndIf
    Wend
  Else
    PrintN("No language categories found.")
  EndIf
 
  Print(#CRLF$ + #CRLF$ + "Press ENTER to exit"): Input()
  CloseConsole()
EndIf