Skip to content

n33kos/iChingAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iChing API 0.2.0

iChing API returns JSON payloads containing a specific or random iChing reading.

Content is sourced from the Wilhelm / Baynes translation of the iChing. This is an imperfect project which is likely to have errors, please feel free to submit issues or pull requests with corrections.

Returned sequences for the lines go from bottom to top 123456 where 1 is the first (bottom) line and 6 is the last (top) line

Usage

/hexagram?cast={cast_type}|?lines={specifi lines}

  • ?lines=997876
    Get specific hexagram (6,7,8,9 notation))
  • ?cast=yarrow
    Get random hexagram using method (threecoin|yarrow)

Payload

  • numbers

    The aged numbers for each line the hexagram represented as 6,7,8, or 9
  • upperTrigram

    Name of the upper trigram
  • lowerTrigram

    Name of the lower trigram
  • title

    English title of the hexagram
  • chineseTitle

    Chinese transliterated title of the hexagram
  • image

    Text of the image
  • judgement

    Text of the judgement
  • lines

    Text of the lines
  • unicodeCharacter

    Hexagram unicode character
  • number

    Hexagram number 1-64
  • description

    Text of the Wilhelm / Baynes description for the hexagram
  • descriptionJudgement

    Text of the Wilhelm / Baynes description for the judgement
  • descriptionImage

    Text of the Wilhelm / Baynes description for the image
  • descriptionLines

    Text of the Wilhelm / Baynes description for the lines (only returns descriptions for lines in the reading)
  • Database

    This API uses a sqlite database to store the iChing content which can be found in the main directory: `./iChing.sqlite`. Feel free to extract and use that database as you like. If you end up using it for multiple projects it may be wise to set up a separate repo containing only the database so its easier to update many consumers with corrections.

    To Do

    • Find a way to cleanly add the readings for "all lines 9" or "All lines 6" on hexagrams 1 and 2. These have been excluded for now.
    • Implement versioning to allow upgrades without breaking old clients
    • Port from PHP to something a more modern and less butts.

    About

    A PHP API which returns iChing readings.

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published

    Languages