Getting context/vocabulary into Pleco (from other apps)

etm001

状元
Hi,

I recently downloaded the new app developed by the creators of The Chairman's Bao (reddit announcement here). In short, it provides a curated list of articles (with accompanying audio) by topic and HSK level. The developer has indicated that an "export to Anki" option will be provided in a future release, and I immediately thought, "I wish I could export into Pleco", since I use it for flashcards.

It would be great if Pleco offered an API that developers could use so that the end user could send content/clozes/flashcards/etc. over to Pleco, which would 1) automatically generate a flashcard set (using pre-defined defaults), or 2) initiating a manual flashcard import process. (I should note that perhaps this doesn't require an API. Perhaps the external developer only has to create a flashcard file that Pleco recognizes, and Pleco is registered as an app that can handle this file/data type on iOS/Android?) Anyway, I think you get the idea.

Thanks!
 
  • Like
Reactions: Wan

mikelove

皇帝
Staff member
We already do have such an API, actually - added in 3.2.0 on iOS and 3.2.13 on Android:

plecoapi://x-callback-url/fl?u=(URL encoded version of the URL to the flashcard list)

The flashcard list filename should end in .txt or .xml depending on the format and should be UTF–8 encoded if it’s the former.
 

etm001

状元
We already do have such an API, actually - added in 3.2.0 on iOS and 3.2.13 on Android

Oh, I did not know this.

The CSV file format is straight forward. Is there a definition for the XML that I could point a developer to? (The theory being that more can be done with the XML file (now or in the future) than with the CSV file, but I'm not sure if that's true).
 

mikelove

皇帝
Staff member
The XML format is undocumented + little used at the moment, not something we want to encourage anybody to build anything around. And for imports of fixed vocabulary lists TXT works just as well anyway.
 
Top