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

  • SEARCH
  • Home
  • 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 8651545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:05:55+00:00 2026-06-12T14:05:55+00:00

I would like to query Wikimedia API to find all images that contain a

  • 0

I would like to query Wikimedia API to find all images that contain a keyword and filter only the images that are public domain. So no additional CC-SA license.

Curently I’m using the following query to extract the images:

http://en.wikipedia.org/w/api.php?action=query&list=search&format=json&srsearch=roses&srnamespace=6&srinfo=totalhits%7Csuggestion&srprop=size%7Cwordcount%7Ctimestamp%7Cscore%7Csnippet%7Ctitlesnippet%7Credirecttitle%7Credirectsnippet%7Csectiontitle%7Csectionsnippet%7Chasrelated&srredirects=&srlimit=10&generator=images&titles=Wikipedia%3APublic_domain&gimlimit=10

But this is curently returning all the images regardless of their licencing. Maybe I need to modify the namespace but I don’t know where to look.

Thanks

  • 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-06-12T14:05:56+00:00Added an answer on June 12, 2026 at 2:05 pm

    Um, your current api query does two very distinct things:

    • get the first 10 images from the page Wikipedia:Public Domain – the pages result, you could specify additional properties to get for that result set
    • search the namespace 6 for the word roses

    Unfortunately, you can’t restrict the search module to search only in some categories, you can only limit it to a single namespace. So you would need to get the categories of all search results and filter them yourself for images in the Category:Public Domain (and all its subcategories). The API query would look like

    api.php?action=query&prop=imageinfo|categories&generator=search&gsrsearch=roses&gsrnamespace=6&format=json

    Don’t forget to continue the query, if you want 10 images that match your category criteria you might need to query (a lot) more than that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have three tables that we would like to query to find out the
I would like to write a query that returns a single date value, that
I would like a query that will show a sum of columns with a
I would like to query my table for how many rows contain one or
I would like to query data given an array to filter by via WCF
I have a lab values table that I would like to query and get
I would like to query the Axapta AOT to find the fields of a
I have a biology database that I would like to query. There is also
I would like to use mysql query profiler in the php script. So that
I would like to query public posts from multiple Pages. My FQL query looks

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.