You are looking at the HTML representation of the XML format.
HTML is good for debugging, but is unsuitable for application use.
Specify the format parameter to change the output format.
To see the non HTML representation of the XML format, set format=xml.
See the complete documentation, or API help for more information.
<?xml version="1.0"?>
<api>
  <query>
    <pages>
      <page pageid="9" ns="0" title="Retrieving Flickr photo views using shell scripting">
        <revisions>
          <rev contentformat="text/x-wiki" contentmodel="wikitext" xml:space="preserve">&lt;pre&gt;
#!/bin/bash
#The purpose of this script is to retrieve the amount of views for your Flickr photos.

#Your Flickr API key
KEY=&quot;&quot;

#Your Flickr user ID
user=&quot;&quot;

#Format for today's date
today=$(date +&quot;%m-%d-%Y&quot;)
totalviews=&quot;0&quot;

#Format for date in filename
filedate=$(date +&quot;%y%m%d_flickr_stats.txt&quot;)
filedateyesterday=$(date --date=&quot;1 day ago&quot; +&quot;%y%m%d_flickr_stats.txt&quot;)

#If you run as an automated cron job this helps to store files
path=&quot;/home/username&quot;

#Get all the IDs of the Flickr photos for certain user using the Flickr API
#Only grep the ID numbers
ids=$(curl -s &quot;https://api.flickr.com/services/rest/?method=flickr.people.getPhotos&amp;api_key=&quot;$KEY&quot;&amp;user_id=&quot;$user&quot;&amp;per_page=500&amp;format=rest&quot; | grep -o -P '(?&lt;=photo id=&quot;).*(?=&quot; owner=)')

#Read the output from variable ids in idsarray, remove all the whitespaces in the ids variable
read -r -a idsarray &lt;&lt;&lt; $ids

#Iterate through the array and for every entry do the following
for id in &quot;${idsarray[@]}&quot;
do
	#Request the information of the photo using the photo's ID
	info=$(curl -s &quot;https://api.flickr.com/services/rest/?method=flickr.photos.getInfo&amp;api_key=&quot;$KEY&quot;&amp;photo_id=&quot;$id&quot;&amp;format=rest&quot;)

	#From the ouput of the API request only take the values for title and views
	title=$(echo $info | grep -o -P '(?&lt;=&lt;title&gt;).*(?=&lt;/title&gt;)')
	views=$(echo $info | grep -o -P '(?&lt;=views=&quot;).*(?=&quot; media)')

	echo &quot;Photo $title has $views views&quot;

	#Get the views for this photo ID from yesterday
	photoviewsyesterday=$(cat $path$filedateyesterday | grep &quot;$id&quot; | cut -d '|' -f 4)

	#Calculate the difference between todays and yesterdays views for this photo ID
	photoviewsdifference=`expr $views - $photoviewsyesterday`

	#Write the output to the file
	echo &quot;$today|$id|$title|$views|$photoviewsdifference&quot;&gt;&gt; $path$filedate

	#Add the current views to the total views
	totalviews=`expr $totalviews + $views`
done

#Get the total views from yesterday
totalviewsyesterday=$(cat &quot;$path&quot;flickr_total_views.txt | grep &quot;$(date --date=&quot;1 day ago&quot; +&quot;%m-%d-%Y&quot;)&quot; | cut -d '|' -f 2)

#Calculate the difference betweeen todays and yesterdays total views
difference=`expr $totalviews - $totalviewsyesterday`

#Write the output to the file
echo &quot;$today|$totalviews|$difference&quot; &gt;&gt; &quot;$path&quot;flickr_total_views.txt
&lt;/pre&gt;</rev>
        </revisions>
      </page>
      <page pageid="6" ns="0" title="Scripting">
        <revisions>
          <rev contentformat="text/x-wiki" contentmodel="wikitext" xml:space="preserve">[[Dynamically splitting output into files while processing]]&lt;br /&gt;
[[Retrieving Flickr photo views using shell scripting]]&lt;br /&gt;
[[Plotting schools Port Elizabeth using shell scripting]]&lt;br /&gt;</rev>
        </revisions>
      </page>
    </pages>
  </query>
</api>