Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7400191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:10:32+00:00 2026-05-29T04:10:32+00:00

I read the MediaWiki API documentation but I cannot find how to get the

  • 0

I read the MediaWiki API documentation
but I cannot find how to get the current URL of the
picture of the day.

Following RTFM, I call the query
from Commons:Potd to its page URL.

It returns pageid=2518149, it is the current POTD page.

Then I try to call prop=imageinfo, but I didn’t find the way to get the image URL.

The only successful call is this:

http://commons.wikimedia.org/w/api.php?titles=File:POTD&action=query&prop=images

“Successful” means it returns an image URL … but of a different pageid (not the current POTD)!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T04:10:33+00:00Added an answer on May 29, 2026 at 4:10 am

    Hmm, this isn’t very easy. You’re not getting anything back from Commons:Potd because that’s just a redirect, but even if you fetch images from Commons:Picture of the Day, you just get a huge list of all images ever in alphabetical order.

    But here’s one solution. First expand the Potd template to figure out the current image name:

    http://commons.wikimedia.org/w/api.php?action=expandtemplates&text={{Potd/{{CURRENTYEAR}}-{{CURRENTMONTH}}-{{CURRENTDAY2}}}}

    <api>
      <expandtemplates xml:space="preserve">20110421 Tbilisi Georgia Panoramic.jpg</expandtemplates>
    </api>
    

    Then plug that filename (URL-encoded) into a separate request to imageinfo, with iiprop=url to get the URL:

    http://commons.wikimedia.org/w/api.php?titles=Image:20110421%20Tbilisi%20Georgia%20Panoramic.jpg&action=query&prop=imageinfo&iiprop=url

    And there it is!
    The picture file itself can be retrieved using the value of the url attribute:

    <api>
      <query>
        <normalized>
          <n from="Image:20110421 Tbilisi Georgia Panoramic.jpg" to="File:20110421 Tbilisi Georgia Panoramic.jpg" />
        </normalized>
        <pages>
          <page pageid="15527584" ns="6" title="File:20110421 Tbilisi Georgia Panoramic.jpg" imagerepository="local">
            <imageinfo>
              <ii url="http://upload.wikimedia.org/wikipedia/commons/a/ae/20110421_Tbilisi_Georgia_Panoramic.jpg" descriptionurl="http://commons.wikimedia.org/wiki/File:20110421_Tbilisi_Georgia_Panoramic.jpg" />
            </imageinfo>
          </page>
        </pages>
      </query>
    </api>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using read line to get some text from wikipedia. But read line only
I read some articles written on "ClassCastException", but I couldn't get a good idea
Read (skimmed enough to get coding) through Erlang Programming and Programming Erlang . One
I read this PHP RegEx page , but either I'm missing something, misreading something,
Read a question on stack overflow sometime back with the following syntax In [1]:
Read that the following code is an example of unsafe construction as it allows
Read some other things on here re: this similar problem but am not sure
I'm replacing an older version of mediawiki and installing mediawiki 1.16.5, but I was
Read this question carefully because I am not asking how to get rid of
Read about the z-index issue and tried anything, but just can't seem to fix

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.