The Protevangelium of James seems to have been written in the second century, almost certainly in Greek; it was certainly known in Alexandria by the third century, although it is usually thought to have been written in Syria. It is perhaps the most influential and important of what are known as the 'Infancy Gospels' (hence the common designation of 'Protevangelium'), hagiographical works that either draw upon or introduce various legends associated with the early life of Christ. Drawing on Matthew and Luke, the book is essentially a legendarium about the Virgin Mary, and much of its influence is due to this. It is almost certainly the earliest work, and certainly the earliest extant work, to give the names 'Anna' and 'Joachim' to the Virgin's parents. The book was translated into perhaps as many as a dozen different languages and widely circulated; besides its considerable influence on Christian artistic and liturgical representation of the Virgin, it is certainly one of the sources for the depiction of Mary in the Quran. This is, I think, fundamentally the way it should be read, as the earliest hagiography of the Virgin Mary (and, indeed, one of a handful of texts that stand at the root of the entire hagiographical tradition), dating from no later than the second half of the second century. While the work gives greater specificity, it is worth noting that many of the traditions found in the work are found in at least summary or allusional form in a wide variety of works, some of which are definitely earlier than this text is usually taken to be -- however one assesses the balance of history and legend in the work, the author is not making things up whole cloth but pulling together the story from Gospel, from oral legend, and from Old Testament prophecy.
The book has had many titles in its history. The earliest title of the work may have been either 'The Birth of Mary' or 'The Book of James' (the latter is the title Origen, the earliest author to give it a title, uses, and variations of both are very common in the manuscripts); the attribution to James is given at the very end of the work. It is usually thought that the James identified is supposed to be the same James as 'James the Brother of the Lord', but it is notable that the work itself actually makes no such claim -- it just gives the author's name as James and says he wrote it at the time of Herod's death (about AD 44) and hid in the wilderness until the uproar after that event had passed. Depending on how one interprets it, that is perhaps consistent with taking the attribution to be to the early Church leader, as is the subject matter, but again, the work itself does not claim this, even if one takes it to suggest it. Given how many Jameses there are in the early Church, it could for all we really know be intending someone else.
The Protevangelium will, of course, be the next fortnightly book. I am reading it in Lily C. Vuong's translation in the Early Christian Apocrypha series published by Cascade books.