Comments (4)
Thank you for reporting. Can you email me your API key so I can check the logs: [email protected]
from docs-api.
Something is keeping the query parameter from coming through.
from docs-api.
Hmm... but querystring is supplied according to docs?
https://api.podcastindex.org/api/1.0/search/byterm?q=javascript
from docs-api.
Got it fixed. Thanks @daveajones for helping me identify it.
The issue had to do with the fact that I was generating request headers on server startup and not for each separate request, as it should have been. 'X-Auth-Date' and 'Authorization' headers are time sensitive and have to regenerated for every request.
Here's updated code (I created a function to generate headers which I'm using in each request):
const generateHeaders = () => {
const ts = Math.floor(Date.now() / 1000)
const authString = `${API_KEY}${API_SECRET}${ts.toString()}`
const authHeader = crypto.createHash('sha1').update(authString).digest('hex')
return {
'Content-Type': 'application/json',
'User-Agent' : "AdamZ's homemade podcast-fetcher 0.01a",
'X-Auth-Key': API_KEY,
'X-Auth-Date': ts,
'Authorization': authHeader
}
}
server.post('/search/term', async (req, res, next) => {
const headers = generateHeaders()
const { term } = req.body
const url = `${API_BASE_URL}search/byterm?q=${term}`
try {
const results = await fetch(url, { headers })
const data = await results.json()
res.json({
message: `Podcasts by term: ${term}`,
data
})
} catch (err) {
next(err)
}
})
from docs-api.
Related Issues (20)
- Multiple type issues HOT 1
- document optional properties HOT 1
- Podcasts byFeedId Endpoint bug HOT 4
- How to query episode based upon podcast? HOT 1
- Authenticate-free way of getting a feed and item information by GUID? HOT 2
- Podcasts By Feed ID endpoint `/podcasts/byfeedid` accepts non-numeric ids HOT 4
- Are URLs to podcasting platforms returned from the API? HOT 1
- ByTerm Search "Atari" HOT 5
- Error in schema documentation: newestItemPublishTime HOT 1
- Request: return the podcast GUID in /podcasts/byitunesid HOT 1
- Sorting of `/search/byterm` endpoint
- new endpoint: recent/modifiedfeeds HOT 7
- New Feeds endpoint returns feeds that By Feed ID endpoint does not recognize HOT 3
- Include socialInteract (comments) data on the episodes returned by the API HOT 5
- Pagination in search endpoint HOT 5
- Recent feeds not returning all expected feeds HOT 5
- Order `/episodes/live` by `datePublished` rather than `id` HOT 1
- Wrong schema description and example for /search/byperson HOT 2
- Type inconsistency for the /podcasts/bytag endpoint HOT 4
- Strange issue with /search/byperson HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docs-api.