changedetection.io icon indicating copy to clipboard operation
changedetection.io copied to clipboard

[feature] API - Unique check when adding a URL

Open dgtlmoon opened this issue 1 year ago • 1 comments

Discussed in https://github.com/dgtlmoon/changedetection.io/discussions/1567

Originally posted by Jomiph May 12, 2023 I hope I'm not doing things wrong, but I noticed, if you try to add a url via the web interface, it will tell you if it already exists in the watch list. But, when adding via the api, there seems to not be such a check, and it adds with a new uuid. Am I missing something, or is there a way to have it check if the url exists? I guess I can work around it by pulling the watch list and comparing against it, but wanted to see if there was a built-in way of doing this.


Good question - I think the answer is that we should add something like uniq=true to the request

curl http://localhost:4000/api/v1/watch?uniq=true -H"x-api-key:xxxx" -H "Content-Type: application/json" -d '{"url": "https://my-nice.com" , "tag": "nice list"}'

See https://github.com/dgtlmoon/changedetection.io/issues/1571

@Jomiph which API call are you using exactly?

dgtlmoon avatar May 16 '23 06:05 dgtlmoon

@dgtlmoon I think after (https://github.com/dgtlmoon/changedetection.io/commit/895c443110ff5bf83d1590bed674cf93260168f1) this one can be closed now.

Noki avatar Apr 03 '24 14:04 Noki