Is there any generic way/API to fetch artifacts generated through jenkins Jobs and stored outside Jenkins?

I have created a Jenkins Job Free Style, through script i am preparing build and uploading that build as an image on docker hub using docker commands as following

docker --version
docker login -u 'docker_USer' -p 'docker_password'
echo "Login done"
echo "Building image..."
docker build -f python-jenkins/Dockerfile -t py-sample-image .
echo "Docker image is built"
echo "Running docker image..."
docker run py-sample-image
echo "images"
docker images
echo "Tagging local image..."
docker tag py-sample-image:latest dockerrepo/jenkins-poc:${BUILD_NUMBER}
echo "Publishing image to docker hub..."
docker push dockerrepo/jenkins-poc:${BUILD_NUMBER}
echo "Docker image is published"

Additionally i have created a declarative pipeline where i am doing same using sh command, declarative pipeline is as follows

    pipeline {
    agent any
    tools {
        // Reference the Docker installation configured in Jenkins Global Tool Configuration
        dockerTool 'dockerx'
    }
    stages {
        stage ('Git checkout') {
            steps {
                script {
                    git branch: 'main', credentialsId: 'github_pass', url: 'https://github.com/levelops/GHA-Test'
                    echo 'checkout jenkins-rnd repo'
                }
            }
        }
        stage ('Login to Docker Image') {
            steps {
                sh "docker login -u ${DOCKER_USER} -p ${DOCKER_PASS}"
                echo 'Logged into docker successfully'
            }
        }
        stage ('Build Docker Image') {
            steps {
                echo 'Building docker image...'
                sh "docker build -f python-jenkins/Dockerfile -t py-sample-image-dp ."
                echo 'Docker image is built'
            }
        }
        stage ('Run Docker Image') {
            steps {
                echo 'Running docker image...'
                sh "docker run py-sample-image-dp"
            }
        }
        stage ('Tag Docker Image') {
            steps {
                echo 'Tagging docker image...'
                sh "docker tag py-sample-image-dp:latest ${DOCKER_USER}/jenkins-poc-declarative-pipeline:${BUILD_NUMBER}"
                echo 'Provided tag to docker image'
            }
        }
        stage ('Publish Docker image') {
            steps {
                echo 'Publishing docker image to hub...'
                sh "docker push ${DOCKER_USER}/jenkins-poc-declarative-pipeline:${BUILD_NUMBER}"
                echo 'Docker image is successfully published to docker hub'
            }
        }
     }
 }

Please note:
here build procedure can be different ie. artifact can be war, zip, xml, txt, image etc. anything
Similarly Artifactory can be jfrog, dockerhub, nexus, some s3 etc.

Question
Is there any way i can get generated Artifact details like Generated Artifact Name, Location etc through any plugin/jenkins API/SDK?

you could create a file (maybe json), that contains all that information and attach that as an artifact to the build. Then you can access that file via it’s url

Is there any way I can get artifact information without altering the existing pipelines?

How should Jenkins be aware of what you’re doing inside an sh step?

I got your point, sh step can be anything, so jenkins is not able to identify which particular step is for artifact building/storing to registry.

So one workaround i am thinking is, to collect artifact information within pipeline execution and send it outside using some curl command through API or File. In all the cases, existing pipelines must be changed.

Thanks for the reply and clarification.