Getting future events from a certain area

all things in musicbrainz has a “life-span” and that life span had 3 fields.
a begin, and end and a checkbox if it is ended (this is mainly used if you know that it is ended but you don’t know when it ended).
the ended checkbox get automagically checked when you enter an end date.

this is all good and well for artists and stuff since the end mostly represents a death or a split from the band. and this can mostly only be but in the database after the fact. (its difficult to predict the future)

but in events you can create stuff that will be happen in the future. (a gig that is next month)
the life span is more a representation of the length. if it is an event that only happens on one day the begin & end are the same date.
but because the end is filled in, the ended checkbox is checked.

but stuff that is in the future haven’t ended yet. they haven’t started yet, so how can they be ended?

the reason i bring this up is i’m looking for a more efficient way get all the events of an area that have not ended yet. (as in they are in the future)

currenlty i do a browse of ALL the events in that area and then once i have al the events i check the date and throw away everything that is in the past.

2 Likes

can you give some examples of such events? :nerd_face:

1 Like

any event that is not in the past.
like this: that is next week.
https://musicbrainz.org/event/3106a447-e6c8-424a-ac25-f09cbf1b17b2v

https://musicbrainz.org/event/3106a447-e6c8-424a-ac25-f09cbf1b17b2

I see:

Date: 2024-12-13

It’s OK, no?
I don’t see any Ended checkbox.

its not visible on the website, you have to look in the data.
https://musicbrainz.org/ws/2/event/3106a447-e6c8-424a-ac25-f09cbf1b17b2?inc=aliases&fmt=json

If you are uncertain whether the event (for example, today is the 7th, and the event is scheduled for the 13th) will proceed as planned on the 13th or whether it will conclude on that day, you can choose to leave the end date blank.

This avoids providing potentially inaccurate information. You can even wait until after the event has actually concluded before adding the information to MB.

1 Like

Are you trying to express that,
for example, if today is the 7th and you add an event with both the start and end dates set for the 13th, then the data should only show as “ended” once the actual date reaches the 13th, rather than immediately marking it as ended as soon as an end date is entered? :zipper_mouth_face:

Yes, the term ended feels that it has ended. But it hasn’t ended since it is in the future…

1 Like

Don’t worry too much about thise web service attribute name, I think.

It means “ends” for events in the future, and it means “ended” for events in the past.

If the attribute would change name depending of the time, it would be a mess to use the API.

No need to change the internal attribute name, as long as the website shows it OK.

As you are taking all events in the future, you can just ignore the ended attribute. :wink:

6 Likes

that’s not always true. if there is a 5 day event and we are at day 3 then the event isn’t in the past yet. it hasn’t ended yet. your more likely to ignore the begin date since it doesn’t matter when it begins. aslong as it hasn’t ended yet.

but again that is not really the problem. i actually need an extra parameter where i can filter on only events in the future.

with this:
https://musicbrainz.org/ws/2/event?area=489ce91b-6658-3307-9877-795b68554c98&limit=100&offset=0&fmt=json
i get ALL the events in america. since there are 32302 events (currently) and i can only get a maximum of 100 events per request and i can only send 1 request per second. that wouuld meen that it would take 324 seconds (5.4 minutes)
after i waited almost 6 minutes i manually check which ones are in the future and wich ones are in the past. this would mean that almost 90% (i am just guestimating here) is not useable since i have no use for the events that are in the past for this application.
it would be more efficient if i couuld add the future only parameter. in stead of having 32302 events i could get like 1000 events wich will only take 10 seconds. AND i don’t need to filter them afterwards.

i think this can be very usefull, if other websites want to use the musicbrainz data to promote events they want to promot the upcoming events, there is no business in promoting events that are in the past.

2 Likes

The attribute really indicates that something has an end. The point is that things can be known to end without knowing a date. In this case the end date will be ended, but the checkbox can still be set. If there is an end date explicitly set it is clear that thing does have an end and the checkbox is set.

The end date is still in the future then, that’s what jesus2099 was talking about.

3 Likes

I suspect that you may need to use the Search API for this (but note that it won’t include as much information as browse requests, e.g. setlists aren’t included).

I am notably bad at writing Lucene queries, but I think that something like https://musicbrainz.org/ws/2/event?query=begin:[2024-12-08%20TO%202099-12-31]&limit=100&fmt=json may work. That yields 912 results, so you’ll still need to page through them. I don’t know if there’s any way to filter by country instead of just by area (which is sometimes e.g. the event’s city).

1 Like

the search isn’t ideal for this.
i can add an aid (area id) but that doesn’t function in the same way as the browse thing functions.

this is the browse thing:
https://musicbrainz.org/ws/2/event?area=56beda2e-dcd5-47e8-ac57-dbe72cf0fbb4&fmt=json
this is the search thing:
https://musicbrainz.org/ws/2/event?query=aid:56beda2e-dcd5-47e8-ac57-dbe72cf0fbb4&fmt=json

i think the reason it doesn’t work is because the area isn’t directly linked to the event. the event has a place and that place has an area.

because if i search for place stuff it does seem to work:
https://musicbrainz.org/ws/2/event?query=place:"bootstraat"%20AND%20end:[2024-12-07%20TO%202030-12-31]&fmt=json

and that is because the place does have a direct link with the event. but the area doesn’t.

1 Like

:warning: The search pagination is broken, at least for works, recordings and release groups.
So, I guess there is the same problem with events.

paging 912 takes 10 seconds (100 per request; 1 request per second)

and i don’t have to filter everything that i don’t need.
opposed to the 5,4 minutes.

the only problem is that i want to oonly have the events of certain area since i have no use to suggest gigs that are too far away.

Ended has no meaning for events, which is why it cannot be set on the site. It should just be ignored on the API entirely.

4 Likes

The area search is also a big want for my FestivalGuide App. I have reported this in the past: https://tickets.metabrainz.org/browse/SEARCH-710

And yes, I think the search endpoint is the only one to accomplish this. I put the liked artists in the mix to get lesser results.