Index: /applications/editors/josm/plugins/wikipedia/src/org/wikipedia/Debouncer.java
===================================================================
--- /applications/editors/josm/plugins/wikipedia/src/org/wikipedia/Debouncer.java	(revision 32625)
+++ /applications/editors/josm/plugins/wikipedia/src/org/wikipedia/Debouncer.java	(revision 32625)
@@ -0,0 +1,39 @@
+package org.wikipedia;
+
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.Future;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+
+public class Debouncer {
+    private final ScheduledExecutorService scheduler;
+    private final ConcurrentHashMap<Object, Future<?>> delayedMap = new ConcurrentHashMap<>();
+
+    public Debouncer(ScheduledExecutorService scheduler) {
+        this.scheduler = scheduler;
+    }
+
+    /**
+     * Debounces {@code callable} by {@code delay}, i.e., schedules it to be executed after {@code delay},
+     * or cancels its execution if the method is called with the same key within the {@code delay} again.
+     */
+    public void debounce(final Object key, final Runnable runnable, long delay, TimeUnit unit) {
+        final Future<?> prev = delayedMap.put(key, scheduler.schedule(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    runnable.run();
+                } finally {
+                    delayedMap.remove(key);
+                }
+            }
+        }, delay, unit));
+        if (prev != null) {
+            prev.cancel(true);
+        }
+    }
+
+    public void shutdown() {
+        scheduler.shutdownNow();
+    }
+}
Index: /applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikidataItemSearchDialog.java
===================================================================
--- /applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikidataItemSearchDialog.java	(revision 32625)
+++ /applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikidataItemSearchDialog.java	(revision 32625)
@@ -0,0 +1,129 @@
+// License: GPL. For details, see LICENSE file.
+package org.wikipedia;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Collections;
+import java.util.List;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.JList;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.JosmAction;
+import org.openstreetmap.josm.gui.ExtendedDialog;
+import org.openstreetmap.josm.gui.util.GuiHelper;
+import org.openstreetmap.josm.gui.widgets.SearchTextResultListPanel;
+import org.openstreetmap.josm.tools.Utils;
+
+public final class WikidataItemSearchDialog extends ExtendedDialog {
+
+    private final Selector selector;
+    private static final WikidataItemSearchDialog INSTANCE = new WikidataItemSearchDialog();
+
+    private WikidataItemSearchDialog() {
+        super(Main.parent, tr("Search Wikidata items"), new String[]{tr("Add ''wikipedia'' tag"), tr("Cancel")});
+        this.selector = new Selector();
+        this.selector.setDblClickListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                buttonAction(0, null);
+            }
+        });
+        setContent(selector, false);
+        setPreferredSize(new Dimension(600, 300));
+    }
+
+    /**
+     * Returns the unique instance of {@code MenuItemSearchDialog}.
+     *
+     * @return the unique instance of {@code MenuItemSearchDialog}.
+     */
+    public static synchronized WikidataItemSearchDialog getInstance() {
+        return INSTANCE;
+    }
+
+    @Override
+    public ExtendedDialog showDialog() {
+        selector.init();
+        super.showDialog();
+        selector.clearSelection();
+        return this;
+    }
+
+    @Override
+    protected void buttonAction(int buttonIndex, ActionEvent evt) {
+        super.buttonAction(buttonIndex, evt);
+        if (buttonIndex != 0) {
+            return;
+        }
+        WikipediaToggleDialog.AddWikipediaTagAction.addTag(selector.getSelectedItem());
+    }
+
+    private static class Selector extends SearchTextResultListPanel<WikipediaApp.WikidataEntry> {
+
+        final Debouncer debouncer = new Debouncer(
+                Executors.newSingleThreadScheduledExecutor(Utils.newThreadFactory("wikidata-search-%d", Thread.NORM_PRIORITY)));
+
+        Selector() {
+            super();
+            lsResult.setCellRenderer(new DefaultListCellRenderer() {
+                @Override
+                public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
+                    final WikipediaApp.WikidataEntry entry = (WikipediaApp.WikidataEntry) value;
+                    final String labelText = "<html>" + entry.getLabelText();
+                    return super.getListCellRendererComponent(list, labelText, index, isSelected, cellHasFocus);
+                }
+            });
+        }
+
+        public WikipediaApp.WikidataEntry getSelectedItem() {
+            final WikipediaApp.WikidataEntry selected = lsResult.getSelectedValue();
+            if (selected != null) {
+                return selected;
+            } else if (!lsResultModel.isEmpty()) {
+                return lsResultModel.getElementAt(0);
+            } else {
+                return null;
+            }
+        }
+
+        @Override
+        protected void filterItems() {
+            final String query = edSearchText.getText();
+            debouncer.debounce(Void.class, new Runnable() {
+                @Override
+                public void run() {
+                    final List<WikipediaApp.WikidataEntry> entries = query == null || query.isEmpty()
+                            ? Collections.<WikipediaApp.WikidataEntry>emptyList()
+                            : WikipediaApp.getWikidataEntriesForQuery(WikipediaToggleDialog.wikipediaLang.get(), query);
+                    GuiHelper.runInEDT(new Runnable() {
+                        @Override
+                        public void run() {
+                            lsResultModel.setItems(entries);
+                        }
+                    });
+                }
+            }, 200, TimeUnit.MILLISECONDS);
+        }
+    }
+
+    public static class Action extends JosmAction {
+
+        public Action() {
+            super(tr("Search Wikidata items"), "dialogs/wikidata", null,
+                    null, true, "dialogs/search-wikidata-items", false);
+        }
+
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            WikidataItemSearchDialog.getInstance().showDialog();
+        }
+    }
+}
Index: /applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaApp.java
===================================================================
--- /applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaApp.java	(revision 32624)
+++ /applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaApp.java	(revision 32625)
@@ -121,4 +121,32 @@
     }
 
+    static List<WikidataEntry> getWikidataEntriesForQuery(final String language, final String query) {
+        try {
+            final String url = "https://www.wikidata.org/w/api.php" +
+                    "?action=wbsearchentities" +
+                    "&language=" + language +
+                    "&strictlanguage=false" +
+                    "&search=" + Utils.encodeUrl(query) +
+                    "&limit=50" +
+                    "&format=xml";
+            final List<WikidataEntry> r = new ArrayList<>();
+            try (final InputStream in = HttpClient.create(new URL(url)).setReasonForRequest("Wikipedia").connect().getContent()) {
+                final Document xml = DOCUMENT_BUILDER.parse(in);
+                final NodeList nodes = (NodeList) X_PATH.compile("//entity").evaluate(xml, XPathConstants.NODESET);
+                final XPathExpression xpathId = X_PATH.compile("@id");
+                final XPathExpression xpathLabel = X_PATH.compile("@label");
+                for (int i = 0; i < nodes.getLength(); i++) {
+                    final Node node = nodes.item(i);
+                    final String id = (String) xpathId.evaluate(node, XPathConstants.STRING);
+                    final String label = (String) xpathLabel.evaluate(node, XPathConstants.STRING);
+                    r.add(new WikidataEntry(id, label, null));
+                }
+            }
+            return r;
+        } catch (Exception ex) {
+            throw new RuntimeException(ex);
+        }
+    }
+
     static List<WikipediaEntry> getEntriesFromCategory(String wikipediaLang, String category, int depth) {
         try {
Index: /applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaPlugin.java
===================================================================
--- /applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaPlugin.java	(revision 32624)
+++ /applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaPlugin.java	(revision 32625)
@@ -15,4 +15,5 @@
         MainMenu.add(Main.main.menu.dataMenu, new WikipediaAddNamesAction());
         MainMenu.add(Main.main.menu.dataMenu, new FetchWikidataAction());
+        MainMenu.add(Main.main.menu.dataMenu, new WikidataItemSearchDialog.Action());
     }
 
Index: /applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaToggleDialog.java
===================================================================
--- /applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaToggleDialog.java	(revision 32624)
+++ /applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaToggleDialog.java	(revision 32625)
@@ -55,5 +55,5 @@
                 new SideButton(new WikipediaLoadCategoryAction()),
                 new SideButton(new PasteWikipediaArticlesAction()),
-                new SideButton(new AddWikipediaTagAction()),
+                new SideButton(new AddWikipediaTagAction(list)),
                 new SideButton(new WikipediaSettingsAction(), false)));
         updateTitle();
@@ -61,5 +61,5 @@
     /** A string describing the context (use-case) for determining the dialog title */
     String titleContext = null;
-    final StringProperty wikipediaLang = new StringProperty("wikipedia.lang", LanguageInfo.getJOSMLocaleCode().substring(0, 2));
+    static final StringProperty wikipediaLang = new StringProperty("wikipedia.lang", LanguageInfo.getJOSMLocaleCode().substring(0, 2));
     final Set<String> articles = new HashSet<>();
     final DefaultListModel<WikipediaEntry> model = new DefaultListModel<>();
@@ -287,8 +287,11 @@
     }
 
-    class AddWikipediaTagAction extends AbstractAction {
-
-        public AddWikipediaTagAction() {
+    static class AddWikipediaTagAction extends AbstractAction {
+
+        private final JList<WikipediaEntry> list;
+
+        public AddWikipediaTagAction(JList<WikipediaEntry> list) {
             super(tr("Add Tag"));
+            this.list = list;
             new ImageProvider("pastetags").getResource().attachImageIcon(this, true);
             putValue(SHORT_DESCRIPTION, tr("Adds a ''wikipedia'' tag corresponding to this article to the selected objects"));
@@ -297,18 +300,27 @@
         @Override
         public void actionPerformed(ActionEvent e) {
-            if (list.getSelectedValue() != null) {
-                Tag tag = ((WikipediaEntry) list.getSelectedValue()).createWikipediaTag();
-                if (tag != null) {
-                    final Collection<OsmPrimitive> selected = Main.getLayerManager().getEditDataSet().getSelected();
-                    if (!GuiUtils.confirmOverwrite(tag.getKey(), tag.getValue(), selected)) {
-                        return;
-                    }
-                    ChangePropertyCommand cmd = new ChangePropertyCommand(
-                            selected,
-                            tag.getKey(), tag.getValue());
-                    Main.main.undoRedo.add(cmd);
-                    Main.worker.submit(new FetchWikidataAction.Fetcher(selected));
-                }
-            }
+            addTag(list.getSelectedValue());
+        }
+
+        static void addTag(WikipediaEntry entry) {
+            if (entry == null) {
+                return;
+            }
+            addTag(entry.createWikipediaTag());
+        }
+
+        static void addTag(Tag tag) {
+            if (tag == null) {
+                return;
+            }
+            final Collection<OsmPrimitive> selected = Main.getLayerManager().getEditDataSet().getSelected();
+            if (!GuiUtils.confirmOverwrite(tag.getKey(), tag.getValue(), selected)) {
+                return;
+            }
+            ChangePropertyCommand cmd = new ChangePropertyCommand(
+                    selected,
+                    tag.getKey(), tag.getValue());
+            Main.main.undoRedo.add(cmd);
+            Main.worker.submit(new FetchWikidataAction.Fetcher(selected));
         }
     }
Index: /applications/editors/josm/plugins/wikipedia/test/unit/org/wikipedia/WikipediaAppTest.java
===================================================================
--- /applications/editors/josm/plugins/wikipedia/test/unit/org/wikipedia/WikipediaAppTest.java	(revision 32624)
+++ /applications/editors/josm/plugins/wikipedia/test/unit/org/wikipedia/WikipediaAppTest.java	(revision 32625)
@@ -147,4 +147,12 @@
             }
         }));
+    }
+
+    @Test
+    public void testForQuery() throws Exception {
+        final List<WikipediaApp.WikidataEntry> entries = WikipediaApp.getWikidataEntriesForQuery("de", "Österreich");
+        assertThat(entries.get(0).wikipediaArticle, is("Q40"));
+        assertThat(entries.get(0).wikipediaLang, is("wikidata"));
+        // assertThat(entries.get(0).label, is("Österreich"));
     }
 
