Search code examples
flickr

Flickr API: Programmatically Accessible Documentation


I'd like to be able to programmatically query the API. For example, I'd like to know what arguments are required/optional, and their types, for a given method. The info must be somewhere because it is used by the Explorer, but I didn't see a way to access it, and I struck out searching because the terms are so generic (e.g. 'metadata' brings up tons of hits on EXIF).

I'm asking because I'm writing a wrapper and want to provide interactive help without having to scrape the web documentation.


Solution

  • Cool! They have exactly what I wanted...

    From https://www.flickr.com/services/api/flickr.reflection.getMethodInfo.html :

    Example Response

    <method name="flickr.fakeMethod" needslogin="1">
      <description>A fake method</description>
      <response>xml-response-example</response>
      <explanation>explanation of example response</explanation>
      <arguments>
        <argument name="api_key" optional="0">
              You API application key.</argument>
        <argument name="color" optional="1">
              Your favorite color.</argument>
      </arguments>
      <errors>
        <error code="1" message="Photo not found">
              Full explanation...</error>
        <error code="100" message="Invalid API Key">
              Full explanation...</error>
      </errors>
    </method>