I am fetching github's api to display my projects. I got titles, descriptions, links but I do not know if there is possibility to get an image from readme.md or from other place? I need it to display next to titles and descriptions. In github repo I have it in dir src/images/image_1 etc.
Asked
Active
Viewed 3,304 times
0
-
See https://stackoverflow.com/questions/9240961/github-jsonp-source-code-api for fetching specific files from git API – junvar Jan 10 '20 at 22:38
-
1What do you mean by "get an image from readme.md or from other place"? readme.md is a text file. – Code-Apprentice Jan 10 '20 at 22:49
-
https://developer.github.com/v3/repos/contents/#get-contents describes how to get a file from your repo. – Code-Apprentice Jan 10 '20 at 22:51
1 Answers
5
Hellow brow, the way is
https://raw.githubusercontent.com/UserName/NameRepo/Branch/NameImg.png
The UserName
is the name of the owner of the repository, NameRepo
is the name of the repository, Branch
is the branch of git, there may be several, but the default is master
, NameImg
is the name of the image and must also be with the expansion.

Marlon Rodrigues
- 66
- 1
- 2