# LibraryController.search

**URL:** <https://discourse.mopidy.com/t/librarycontroller-search/5487>\
**Category:** Misc\
**Created:** [June 2, 2022, 4:12pm UTC](https://discourse.mopidy.com/t/librarycontroller-search/5487 "2022-06-02T16:12:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![fmarzocca](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/fmarzocca/32/1095_2.png) [@fmarzocca](https://discourse.mopidy.com/u/fmarzocca)\
**Post date:** [June 2, 2022, 4:12pm UTC](https://discourse.mopidy.com/t/librarycontroller-search/5487/1 "2022-06-02T16:12:23Z")

</div>

I am wondering if it’s possible to use the core method `LibraryController.search` to search for tracks in tunein. I have tried with this:

```auto
curl -d '{"jsonrpc":"2.0","id":1,"method":"core.library.search","params":{"query":{"artist":"Manu Chao"}, "uris":["tunein:"]}}' -H 'Content-Type: application/json' http://localhost:6680/mopidy/rpc

```

but it just returns:

```auto
{"jsonrpc": "2.0", "id": 1, "result": [{" __model__": "SearchResult", "uri": "tunein:search"}]}

```

---

<div class="post-metadata">

**Author:** ![kingosticks](https://avatars.discourse-cdn.com/v4/letter/k/858c86/32.png) [@kingosticks](https://discourse.mopidy.com/u/kingosticks)\
**Post date:** [June 2, 2022, 7:37pm UTC](https://discourse.mopidy.com/t/librarycontroller-search/5487/2 "2022-06-02T19:37:27Z")

</div>

Search is supported, I hope the readme stated this already. But I don’t think it supports anything except basic ‘any’ searches. Did you try that?

---

<div class="post-metadata">

**Author:** ![fmarzocca](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/fmarzocca/32/1095_2.png) [@fmarzocca](https://discourse.mopidy.com/u/fmarzocca)\
**Post date:** [June 2, 2022, 8:26pm UTC](https://discourse.mopidy.com/t/librarycontroller-search/5487/3 "2022-06-02T20:26:12Z")

</div>

If I use ‘any’:

```auto
curl -d '{"jsonrpc":"2.0","id":1,"method":"core.library.search","params":{"query":{"artist":"Manu Chao"}, "uris":["any"]}}' -H 'Content-Type: application/json' http://localhost:6680/mopidy/rpc

```

it doesn’t work, giving this error:

```auto
mopidy.exceptions.ValidationError: Expected a list of URIs, not 'any'

```

but it works if, instead of ‘any’, I put ‘tidal:’. But I was in the need to search in tunein,

---

<div class="post-metadata">

**Author:** ![kingosticks](https://avatars.discourse-cdn.com/v4/letter/k/858c86/32.png) [@kingosticks](https://discourse.mopidy.com/u/kingosticks)\
**Post date:** [June 2, 2022, 9:22pm UTC](https://discourse.mopidy.com/t/librarycontroller-search/5487/4 "2022-06-02T21:22:37Z")

</div>

Any is a field value. See the docs [mopidy.core — Core API — Mopidy 3.3.0 documentation](https://docs.mopidy.com/en/latest/api/core/#mopidy.core.LibraryController.search)

---

<div class="post-metadata">

**Author:** ![fmarzocca](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/fmarzocca/32/1095_2.png) [@fmarzocca](https://discourse.mopidy.com/u/fmarzocca)\
**Post date:** [June 3, 2022, 8:11am UTC](https://discourse.mopidy.com/t/librarycontroller-search/5487/5 "2022-06-03T08:11:24Z")

</div>

Yes, of course. Sorry, my mistake.  
Anyway, this line works:

```auto
curl -d '{"jsonrpc":"2.0","id":1,"method":"core.library.search","params":{"query":{"any":"Manu Chao"}, "uris":["tunein:"]}}' -H 'Content-Type: application/json' http://localhost:6680/mopidy/rpc

```

the only issue is that I cannot limit the search to “Artist” or “album”.  
I can live with that. Thanks

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/system/32/1_2.png) [@system](https://discourse.mopidy.com/u/system)\
**Post date:** [December 2, 2022, 8:12pm UTC](https://discourse.mopidy.com/t/librarycontroller-search/5487/6 "2022-12-02T20:12:08Z")

</div>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
