laptop curl Youtube API v3 request always returns 'Exceeded Quota' error - youtube-data-api

Every time I attempt to use the following simple bash script command on my Macbook Pro laptop, I get an 'Exceeded Quota' error. I do supply a valid API key and I'm under the impression that I don't need any other tokens because I am only requesting Public information (a simple list of songs).
Bash script:
#!/bin/bash
curl \
'https://youtube.googleapis.com/youtube/v3/search?part=snippet&q=music&type=video&key=[My API key]' \
--header 'Accept: application/json' \
--compressed
Reply:
{
"error": {
"code": 403,
"message": "The request cannot be completed because you have exceeded your \u003ca href=\"/youtube/v3/getting-started#quota\"\u003equota\u003c/a\u003e.",
"errors": [
{
"message": "The request cannot be completed because you have exceeded your \u003ca href=\"/youtube/v3/getting-started#quota\"\u003equota\u003c/a\u003e.",
"domain": "youtube.quota",
"reason": "quotaExceeded"
}
]
}
}
I don't have any quota problems pulling song lists via the YouTube Data API 'list' page:
https://developers.google.com/youtube/v3/docs/search/list

Related

How can I fetch all job openings data by using zoho recruiter API?

I want to fetch all the jobs that I posted on my Zoho recruit. And I want to fetch all those jobs on my website for that I use the below API.
curl "https://recruit.zoho.com/recruit/v2/jobopening"
-X GET
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
Scope:
scope=ZohoRECRUIT.modules.jobopening.READ
I use all the necessary parameters but still it give the error like
{
"code": "INTERNAL_ERROR",
"details": {},
"message": "EXTRA_PARAM_FOUND",
"status": "error"
}

Invalid Argument on API Call?

I am getting an invalid argument with the following API Call (following https://developers.google.com/nest/device-access/api/doorbell-battery#webrtc):
curl -X POST 'https://smartdevicemanagement.googleapis.com/v1/enterprises/projectID/devices/deviceID:executeCommand' -H 'Content-Type: application/json'
-H 'Authorization: AUTHTOKEN' --data-raw '{
"command" : "sdm.devices.commands.CameraLiveStream.GenerateWebRtcStream",
"params" : {
"offerSdp" : "a=recvonly"
}
}'
Response from server:
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT"
}
}
What is the invalid argument?
My impression is that is not a valid offer, and you need to use a web rtc client to create it. See webrtc.org for examples.
"offerSdp" : "a=recvonly" isn't a valid offer, but also you will get that INVALID_ARGUMENT error if you don't end your offer string with a \r\n character.

Near mainnet api: Error Block Missing (unavailable on the node)

I was testing near apis and only a few endpoints are working as expected.
https://rpc.mainnet.near.org
I was trying to fetch the block by id and it was throwing this error.
{
"jsonrpc": "2.0",
"error": {
"code": -32000,
"message": "Server error",
"data": "Block Missing (unavailable on the node): BBht2EZwfrGrucZKUuW91tMctfE3rMsUQJcFSduTRCGR \n Cause: Unknown"
},
"id": "dontcare"
}
The final block call is working and it is even working for few 50 blocks back but for old blocks it is throwing above error.
Is there any range of blocks this api supports?
Can I rely on this api to fetch historical data?
curl request
curl --location --request POST 'https://rpc.mainnet.near.org' --header 'Content-Type: application/json' --data-raw '{
"jsonrpc": "2.0",
"id": "dontcare",
"method": "block",
"params": {
"block_id": 33929500
}
}'
This block was garbage collected. Regular nodes only maintain blocks for the last 5 epochs, if you need historical data you should query instead archival nodes (https://archival-rpc.mainnet.near.org)
See this answer for more details https://stackoverflow.com/a/67199078/4950797

unable to get near protocol transaction status via RPC

Given a transaction https://explorer.near.org/transactions/JBb2DDe3i1CtBwESisLuhxXkWVZpCKYL4J1AdYwAQPsQ
When I query NEAR rpc:
http post https://rpc.mainnet.near.org jsonrpc=2.0 method=tx params:='["JBb2DDe3i1CtBwESisLuhxXkWVZpCKYL4J1AdYwAQPsQ","wasmgit.near"]' id=dontcare
Then I expect to get the transaction status
Instead I get the following response:
{
"error": {
"code": -32000,
"data": "Transaction JBb2DDe3i1CtBwESisLuhxXkWVZpCKYL4J1AdYwAQPsQ doesn't exist",
"message": "Server error"
},
"id": "dontcare",
"jsonrpc": "2.0"
}
source: https://docs.near.org/docs/api/rpc#setup
Querying historical data (older than 5 epochs or ~2.5 days), you may
get responses that the data is not available anymore. In that case,
archival RPC nodes will come to your rescue:
mainnet https://archival-rpc.mainnet.near.org
testnet https://archival-rpc.testnet.near.org
You can see this interface defined in nearcore here.
via near-cli
near --nodeUrl https://archival-rpc.mainnet.near.org \
tx-status JBb2DDe3i1CtBwESisLuhxXkWVZpCKYL4J1AdYwAQPsQ \
--accountId wasmgit.near
via http
http post https://archival-rpc.mainnet.near.org \
jsonrpc=2.0 method=tx \
params:='["JBb2DDe3i1CtBwESisLuhxXkWVZpCKYL4J1AdYwAQPsQ","wasmgit.near"]' \
id=dontcare

Model is not deployed and cannot predit

On Google Cloud Automl - Language Classification, I put in the following request for prediction.
I am getting - The model is not deployed, hence not supported for prediction yet.
How do we deploy a model ? I do not see any documentation if deploying a model
I am running this command shown in code in Google Cloud Shell
curl -X POST -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" -H "Content-Type: application/json" https://automl.googleapis.com/v1beta1/projects/[projectid]/locations/us-central1/models/[Modelname]:predict -d '{
"payload" : {
"textSnippet": {
"content": "YOUR TEXT HERE",
"mime_type": "text/plain"
},
}
}'
{
"error": {
"code": 400,
"message": "The model is not deployed, hence not supported for prediction yet.",
"status": "FAILED_PRECONDITION"
}
}
Expected prediction
You can deploy a successfully trained model using the UI on GCP.
Under HOME go to your respective AI and find your model in its dashboard.

Resources