If this is happening every loo trip for a wee - first thing to do is take a sample of your your pee in a sterile pot to the GP and get it tested for infection and blood and protein contents etc.
The GP will dip a strip of paper in the we and wait to see what colours it shows up. If it shows blood or infection then the GP will give you antibiotics initially - but also ask the GP to send off the pee to identify which bug is causing the infection AND which antibiotics will kill it.
Otherwise you could spend months battling through one antibiotic after another trying to hit the jackpot and find the one that the bug is not drug resistant to.
This costs ou a fortune in prescriptions and all antibiotics mess up your good bacteria in the gut, and can give you thrush as well so the quicker you get on the right drug the better.
Use the search box on the green bar to look for previous posts about "biofilm" and ecoli.
This is a big problem if you have endo and the bug most commonly causing the bladder probs is E-coli.
Your description of what's happening certainly could be e-coli infection. But there are other bugs that can cause a urinary tract infection.
It ma turn out not to be an infection and be endo related cystitis or interstitial cystitis. which requires different treatments.
Don't suffer in silence - do see our GP and if this is an infection - complete ALL the antibiotic tablets even if the make you feel rather lousy, and wait a week or two and get our pee retested to make sure that there is no recurring infection.
Repeat UTIs are very common with endo.
You can pick up a sample pot from the surgery or local chemists or NHS drop in centres for free - I would suggest you collect a couple of them one for the 1st sample of pee and one to use as a follow up after treatment. You can always go back for more pee pots if you need them. No need to fill in the label, just collect mid-stream sample of pee 1st pee in the morning.
So pee a little in the loo, stop and pee a bit more in to a sterile and clean ex-ice cream tub or something similar and then stop and sit back on the loo for the rest of the wee.
Then empty a couple of inches worth of pee in to the sample pot and put the lid on tightly. Discard the ex-food tub after rinsing it out just in case it is contaminated with a bug.