Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Event Calendar API call returns Total Entries = 0

52 views
Skip to first unread message

Conal

unread,
Feb 12, 2020, 4:43:35 AM2/12/20
to Songkick API
Hi,

Can anyone help please?

When I make an API Event Calendar get request by simply adding the URL with a valid metro_area_id and API key below I get a good response, total entries = 1536

Screen Shot calendar URL.png

But when I try to get a response by using axios.get with the same URL and variables with the same value passed in for metro_area_id & api key I get a response but the total entries = 0, so I get no data.

Screen Shot axios request.png

Screen Shot calendar response.png

Why does this happen? Am I doing something wrong? Thank you
Conal

Chloe Verity

unread,
Feb 12, 2020, 4:54:57 AM2/12/20
to Songkick API
Hi Conal,

I'd love to help, unfortunately I can't seem to view the attached photos - would you mind trying to attach them again?

Best,
Chloe

Conal

unread,
Feb 12, 2020, 2:09:30 PM2/12/20
to Songkick API
Hi Chloe,

Thank you in advance for your help.

When I make an API Event Calendar get request by simply typing the URL into the browser with a valid metro_area_id and API key below I get a good response, total entries = 1536

API response is good, has data content with totalEntries = 1594

But when I try to get a response by using axios.get with the same URL and variables with the same value passed in for metro_area_id & api key I get a response but the total entries = 0, so I get no data. Please see code and response below.

    function findEventLoc(locIddateFromdateTo){

            params: {
                apikey: 'bguT074ohahXwEwu',
                metro_area_id: locId,
                min_date: dateFrom,
                max_date: dateTo
            }
        })
            .then(function (response) {
                $(function() {
                    console.log(response);
                })
            })
            .catch(function (error) {
                console.log(error);
            })
    }

Response Object, no data content, totalEntries = 0;
  1. Object
    1. data:
      1. resultsPage:
        1. status"ok"
        2. perPage50
        3. page1
        4. totalEntries0
    2. status200
    3. statusText""
    4. config:
      1. url"https://api.songkick.com/api/3.0/metro_areas/{metro_area_id}/calendar.json?apikey={your_api_key}"
      2. method"get"
      3. timeout0
      4. xsrfCookieName"XSRF-TOKEN"
      5. xsrfHeaderName"X-XSRF-TOKEN"
      6. maxContentLength-1
      7. dataundefined
    5. requestXMLHttpRequest
      1. readyState4
      2. timeout0
      3. withCredentialsfalse
      4. responseURL"https://api.songkick.com/api/3.0/metro_areas/%7Bmetro_area_id%7D/calendar.json?apikey={your_api_key}&apikey=bguT074ohahXwEwu&metro_area_id=24475&min_date=2020-02-12&max_date=2020-02-29"
      5. status200
      6. statusText""
      7. responseType""
      8. response"{"resultsPage":{"status":"ok","results":{},"perPage":50,"page":1,"totalEntries":0}}"
      9. responseText"{"resultsPage":{"status":"ok","results":{},"perPage":50,"page":1,"totalEntries":0}}"
      10. responseXMLnull
      11. onloadstartnull
      12. onprogressnull
      13. onloadnull
      14. onloadendnull
I can't seem to figure this out, in another part of my code I use the events API call in a similar way to search an artists name and it works fine, I get a good response with data but when I use the calendar API call above I get no entries.

    function findEvents(userInputdateFromdateTo) {
        axios.get('https://api.songkick.com/api/3.0/events.json', {
            params: {
                apikey: 'bguT074ohahXwEwu',
                artist_name: userInput,
                min_date: dateFrom,
                max_date: dateTo
            }
        })
            .then(function (response) {
                $(function() {
                    // The function getData is called here and saved to a variable
                    console.log(response);

Thanks very much,
Conal

Chloe Verity

unread,
Feb 13, 2020, 6:20:31 AM2/13/20
to songki...@googlegroups.com
Hi Conal,

I think you should be able to remove apikey={your_api_key} from your axios get as you're already passing in the apiKey as a param. There also needs to be a string interpolation of the metro_area_id inside the slug rather than as a parameter.

Hope this helps!

Best,
Chloe

--
You received this message because you are subscribed to the Google Groups "Songkick API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to songkick-api...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/songkick-api/469e3936-cdc8-4d0b-aab1-079c364b9960%40googlegroups.com.


--
Chloe Verity | Software Developer

Conal Walsh

unread,
Feb 13, 2020, 12:28:46 PM2/13/20
to songki...@googlegroups.com
Hi Chloe,

Yes! The string interpolation did the trick, thank you very much, that was driving me crazy, it works.

Thanks again,
Conal

Chloe Verity

unread,
Feb 14, 2020, 4:54:49 AM2/14/20
to songki...@googlegroups.com
Hi Conal,

Since this API has been made public to anyone on this forum I have disabled it. I have privately emailed you with a replacement key.

Best regards,
Chloe

Reply all
Reply to author
Forward
0 new messages