Piped
Piped copied to clipboard
API Documentation
(edit: read below two comments) Will there ever be api support so apps can use the Piped Extraction? Invidious has api support and services like FreeTube cannot interact with it unless it is through the UI.
- thanks.
There is API, but it's currently undocumented, it's something that has to be done. The official client (this repository) uses it.
The list of API instances can be found at https://github.com/TeamPiped/Piped/wiki/Instances
OK. So this issue is now based around documenting the API.
Some basic documentation for the Streams API has been added, let me know what you think about it: https://piped-docs.kavin.rocks/docs/api-documentation/, I'll be adding the remaining within the next few days hopefully.
~~The comments/description for the fields look a bit odd, but that can be fixed hopefully.~~ Fixed.
@FireMasterK
documentatoin
Whoops, that's fixed now!
More API documentation has been added, precisely comments, trending, playlists, search suggestions, and sponsors/SponsorBlock.
The Search API is subject to a lot of changes, so that will be added later.
Are you interested in the private/authenticated API too? If not, I will defer the writing of documentation for that.
I mean yes it would be useful for authenticated use. Would make sense so more people can interact with this project.
This just some notes I found when I was trying to implement your API in my script
# Trending
api : ${PIPEDAPI_URL}/trending?region={query}
- support select region: use region as query
- region parameter is necessary, use US if empty
- region parameter need to be a valide ISO 3166-1 codes,
- not all ISO 3166-1 codes are supported,fallback to US
- don't support pagination , mark first page as the last page
# Search
api : ${PIPEDAPI_URL}/search?q={query}&filter=videos
- support pagination, use nextpagequery
- last page indicator is "nextpage=null"
- nexpage search api is different from search api
- need to encode {nextpage}
nextpagequery = "search/?nextpage={nextpage}&q={query}&filter=videos"
# URL Handler
## */channel/*, */c/*, */user/*
api : ${PIPEDAPI_URL}/{type}/{channelid}
- don't support search query
- support pagination, use nextpagequery
- last page indicator is "nextpage=null"
- nexpage channel api is different from search api
- need to extract channelid from api for /c/, /user/
- channelid only available in first page
nextpagequery = "channel/{channelid}/?nextpage={nextpage}"
## *"/playlist?list="*
api : ${PIPEDAPI_URL}/playlists/{playlistid}
- don't support search query
- support pagination, use nextpagequery
- last page indicator is "nextpage=null"
- nexpage playlist api is different from search api
nextpagequery = "playlists/{playlistid}/?nextpage={nextpage}"
# Next Page
api : ${PIPEDAPI_URL}/nextpage/{nextpagequery}
# Limitation
- don't support search in channels
All of these should be already documented with the exception of search.
You can find a list of accepted countries at: https://github.com/TeamNewPipe/NewPipeExtractor/blob/4b147863ec44b77a85dfe0a99a010cd10a7f23b4/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/YoutubeService.java#L202-L209
I know I am about a year or so late but is it possible that:
- Search gets documented on the api documentation
- The search easily provides the videoId not with "/watch?v=" nonesense
I need this for a python script I am trying to create for searching different platforms and I would like to show comments, for that I need to get the videoId which is harder to get when for some reason "/wach?v=" is in the url value.
You can use the following regex to extract the ID: ([a-zA-Z0-9_-]{11})
Python code:
regex = r"([a-zA-Z0-9_-]{11})"
test_str = "/watch?v=qwertyuiopq"
matches = re.finditer(regex, test_str)
Are we able to get updated docs for the current state of the API? Many routes such as search are still undocumented.
You can have a look at https://elements-demo.stoplight.io/?spec=https://raw.githubusercontent.com/TeamPiped/OpenAPI/main/swagger.yaml#/operations/trending, however many routes are still not present. (such as search)
I will take a look at adding it in the near future.
I think this addition would be really good for developers.